Macro for distigushing XIAO akin to ARDUINO_ARCH_AVR

Is there a #define for distinguishing the XIAO SAMD21 Cortex M0+?

For instance:

#if defined(ARDUINO_ARCH_AVR)
// It's an Arduino UNO
#elif defined(ARDUINO_ARCH_ESP32)
// It's an ESP32
// It's an XIAO...

I have an application that compiles/runs for Arduino, Trinket M0, and XIAO. I use the define:
to detect the XIAO. If you turn on the detail output from the compiler and look at the gcc commands you can see the various defines (e.g. -D SEEED_XIAO_M0) used for the different platforms.

1 Like