Compiler defines for LPC11U24/LPC1768?

26 Jan 2012

Are there #defines that can be used at compile time to determine the mbed target code is being built for?

e.g.

#if LPC11U24
/* 11U24 specific code. */
#else
#endif

or

#if LPC1768
/* Use built-in ethernet. */
#else
/* Use serial or wifly. */
#endif
26 Jan 2012

If you have a peek at some of the mbed headers, you can see lines like this:

#if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
...
#elif defined(TARGET_LPC11U24)
...
#endif
26 Jan 2012

Thanks! That's what I needed.