Describes predefine macros for mbed online compiler (armcc)

Committer:
MACRUM
Date:
Thu Oct 15 04:17:31 2015 +0000
Revision:
3:b802baa84f98
Parent:
2:fe7a36257939
Child:
4:2b25b7a2c5fd
Add mbed library version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MACRUM 0:99f7e7890e03 1 #include "mbed.h"
MACRUM 0:99f7e7890e03 2
MACRUM 0:99f7e7890e03 3 Serial pc(USBTX, USBRX); // tx, rx
MACRUM 0:99f7e7890e03 4
MACRUM 0:99f7e7890e03 5 int main() {
MACRUM 1:5d5b5bd67e5b 6 #ifdef MBED_USERNAME
MACRUM 1:5d5b5bd67e5b 7 #define STRING(str) pc.printf(#str);
MACRUM 1:5d5b5bd67e5b 8 pc.printf("mbed username: ");
MACRUM 1:5d5b5bd67e5b 9 STRING(MBED_USERNAME);
MACRUM 1:5d5b5bd67e5b 10 pc.printf("\n\n");
MACRUM 1:5d5b5bd67e5b 11 #endif
MACRUM 3:b802baa84f98 12 pc.printf("mbed library version: %d\n", MBED_LIBRARY_VERSION);
MACRUM 2:fe7a36257939 13 #ifdef __CC_ARM
MACRUM 0:99f7e7890e03 14 pc.printf("Built with ARM compiler\n\n");
MACRUM 0:99f7e7890e03 15 pc.printf("ARM Compiler version : %d\n", __ARMCC_VERSION);
MACRUM 0:99f7e7890e03 16
MACRUM 0:99f7e7890e03 17 #ifdef __ARM_NEON__
MACRUM 0:99f7e7890e03 18 pc.printf("NEON is available\n");
MACRUM 0:99f7e7890e03 19 #else
MACRUM 0:99f7e7890e03 20 pc.printf("NEON is not available\n");
MACRUM 0:99f7e7890e03 21 #endif
MACRUM 0:99f7e7890e03 22
MACRUM 0:99f7e7890e03 23 #ifdef __APCS_INTERWORK
MACRUM 0:99f7e7890e03 24 pc.printf("ARM/Thumb Interworking is used\n");
MACRUM 0:99f7e7890e03 25 #endif
MACRUM 0:99f7e7890e03 26
MACRUM 0:99f7e7890e03 27 #ifdef __APCS_ROPI
MACRUM 0:99f7e7890e03 28 pc.printf("--apcs /ropi is used\n");
MACRUM 0:99f7e7890e03 29 #endif
MACRUM 0:99f7e7890e03 30
MACRUM 0:99f7e7890e03 31 #ifdef __APCS_RWPI
MACRUM 0:99f7e7890e03 32 pc.printf("--apcs /rwpi is used\n");
MACRUM 0:99f7e7890e03 33 #endif
MACRUM 0:99f7e7890e03 34
MACRUM 0:99f7e7890e03 35 #ifdef __APCS_FPIC
MACRUM 0:99f7e7890e03 36 pc.printf("--apcs /fpic is used\n");
MACRUM 0:99f7e7890e03 37 #endif
MACRUM 0:99f7e7890e03 38
MACRUM 0:99f7e7890e03 39 #ifdef __BIG_ENDIAN
MACRUM 0:99f7e7890e03 40 pc.printf("Target is big endian\n");
MACRUM 0:99f7e7890e03 41 #endif
MACRUM 0:99f7e7890e03 42
MACRUM 0:99f7e7890e03 43 #ifdef __CHAR_UNSIGNED__
MACRUM 0:99f7e7890e03 44 pc.printf("char type is unsigned\n");
MACRUM 0:99f7e7890e03 45 #else
MACRUM 0:99f7e7890e03 46 pc.printf("char type is signed\n");
MACRUM 0:99f7e7890e03 47 #endif
MACRUM 0:99f7e7890e03 48 pc.printf("EDG front-end version : %d\n", __EDG_VERSION__);
MACRUM 0:99f7e7890e03 49
MACRUM 0:99f7e7890e03 50 pc.printf("Emulated GNU version : %d.%d\n", __GNUC__, __GNUC_MINOR__);
MACRUM 0:99f7e7890e03 51 pc.printf("Current emulated GNU version : %s\n", __VERSION__);
MACRUM 0:99f7e7890e03 52
MACRUM 0:99f7e7890e03 53 pc.printf("Optimize level : %d\n", __OPTIMISE_LEVEL);
MACRUM 0:99f7e7890e03 54
MACRUM 0:99f7e7890e03 55 #ifdef __OPTIMISE_SPACE
MACRUM 0:99f7e7890e03 56 pc.printf("Optimized by size\n");
MACRUM 0:99f7e7890e03 57 #endif
MACRUM 0:99f7e7890e03 58
MACRUM 0:99f7e7890e03 59 #ifdef __OPTIMISE_TIME
MACRUM 0:99f7e7890e03 60 pc.printf("Optimized by speed\n");
MACRUM 0:99f7e7890e03 61 #endif
MACRUM 0:99f7e7890e03 62
MACRUM 0:99f7e7890e03 63 pc.printf("Target ARM architecture : %d\n", __TARGET_ARCH_ARM);
MACRUM 0:99f7e7890e03 64 pc.printf("Target Thumb architecture : %d\n", __TARGET_ARCH_THUMB);
MACRUM 0:99f7e7890e03 65 #else
MACRUM 0:99f7e7890e03 66 pc.printf("Not build with ARM compiler\n");
MACRUM 0:99f7e7890e03 67 #endif
MACRUM 0:99f7e7890e03 68 while(1)
MACRUM 0:99f7e7890e03 69 ;
MACRUM 0:99f7e7890e03 70 }
MACRUM 0:99f7e7890e03 71
MACRUM 0:99f7e7890e03 72