Describes predefine macros for mbed online compiler (armcc)

Revision:
4:2b25b7a2c5fd
Parent:
3:b802baa84f98
Child:
6:40e873bbc5f7
--- a/main.cpp	Thu Oct 15 04:17:31 2015 +0000
+++ b/main.cpp	Thu Jan 12 01:44:21 2017 +0000
@@ -1,17 +1,33 @@
 #include "mbed.h"
 
+#define xstr(s) str(s)
+#define str(s) #s
+
+#if defined(TARGET_SAMD21J18A)
+Serial pc(PB22, PB23); // tx, rx
+DigitalOut myled(PA17, 0);
+#elif defined(TARGET_LPC1768)
+#define LED1 P0_22
 Serial pc(USBTX, USBRX); // tx, rx
+DigitalOut myled(P0_22, 1);
+#else
+Serial pc(USBTX, USBRX); // tx, rx
+DigitalOut myled(LED1, 0);
+#endif
 
 int main() {
+    pc.printf("\n");
+    pc.printf("System Clock = %d\n", SystemCoreClock);
 #ifdef MBED_USERNAME
-#define STRING(str) pc.printf(#str);
-    pc.printf("mbed username: ");
-    STRING(MBED_USERNAME);
-    pc.printf("\n\n");
+    pc.printf("mbed username: %s\n", xstr(MBED_USERNAME));
 #endif
     pc.printf("mbed library version: %d\n", MBED_LIBRARY_VERSION);
 #ifdef __CC_ARM
-    pc.printf("Built with ARM compiler\n\n");
+#ifdef __MICROLIB
+    pc.printf("Built with ARM compiler and micro library (uARM)\n");
+#else
+    pc.printf("Built with ARM compiler and standard library (ARM)\n");
+#endif
     pc.printf("ARM Compiler version : %d\n", __ARMCC_VERSION);
 
 #ifdef __ARM_NEON__
@@ -38,6 +54,8 @@
 
 #ifdef __BIG_ENDIAN
     pc.printf("Target is big endian\n");
+#else
+    pc.printf("Target is little endian\n");
 #endif
 
 #ifdef __CHAR_UNSIGNED__
@@ -65,8 +83,9 @@
 #else
     pc.printf("Not build with ARM compiler\n");
 #endif
-    while(1)
-        ;
+
+    while(1) {
+        myled = !myled;
+        wait(0.4);
+    }
 }
-
-