Describes predefine macros for mbed online compiler (armcc)

main.cpp

Committer:
MACRUM
Date:
2015-04-13
Revision:
2:fe7a36257939
Parent:
1:5d5b5bd67e5b
Child:
3:b802baa84f98

File content as of revision 2:fe7a36257939:

#include "mbed.h"

Serial pc(USBTX, USBRX); // tx, rx

int main() {
#ifdef MBED_USERNAME
#define STRING(str) pc.printf(#str);
    pc.printf("mbed username: ");
    STRING(MBED_USERNAME);
    pc.printf("\n\n");
#endif
#ifdef __CC_ARM
    pc.printf("Built with ARM compiler\n\n");
    pc.printf("ARM Compiler version : %d\n", __ARMCC_VERSION);

#ifdef __ARM_NEON__
    pc.printf("NEON is available\n");
#else
    pc.printf("NEON is not available\n");
#endif

#ifdef __APCS_INTERWORK
    pc.printf("ARM/Thumb Interworking is used\n");
#endif

#ifdef __APCS_ROPI
    pc.printf("--apcs /ropi is used\n");
#endif

#ifdef __APCS_RWPI
    pc.printf("--apcs /rwpi is used\n");
#endif

#ifdef __APCS_FPIC
    pc.printf("--apcs /fpic is used\n");
#endif

#ifdef __BIG_ENDIAN
    pc.printf("Target is big endian\n");
#endif

#ifdef __CHAR_UNSIGNED__
    pc.printf("char type is unsigned\n");
#else
    pc.printf("char type is signed\n");
#endif
    pc.printf("EDG front-end version : %d\n", __EDG_VERSION__);

    pc.printf("Emulated GNU version : %d.%d\n", __GNUC__, __GNUC_MINOR__);
    pc.printf("Current emulated GNU version : %s\n", __VERSION__);

    pc.printf("Optimize level : %d\n", __OPTIMISE_LEVEL);

#ifdef __OPTIMISE_SPACE
    pc.printf("Optimized by size\n");
#endif

#ifdef __OPTIMISE_TIME
    pc.printf("Optimized by speed\n");
#endif

    pc.printf("Target ARM architecture : %d\n", __TARGET_ARCH_ARM);
    pc.printf("Target Thumb architecture : %d\n", __TARGET_ARCH_THUMB);
#else
    pc.printf("Not build with ARM compiler\n");
#endif
    while(1)
        ;
}