BOARD preprocessor directives from IDE

jgmdavies:
I agree with craiglindley, this would be very useful.

Other people have talked about #defines like:

BOARD_ARDUINO_MEGA
BOARD_ARDUINO_DUE

Do they exist, or are there any plans to add them? Can pYro_65's approach be used to uniquely identify a board product?

Jim

Not a board, but the chip used on it. Some boards have the same chip.

The newer IDE defines all the boards like this:
ARDUINO_SAMD_ZERO
ARDUINO_AVR_LEONARDO
ARDUINO_AVR_UNO
ARDUINO_SAM_DUE
ARDUINO_ESP8266_ESP01

There is also defines for boards that use a specific architecture.
ARDUINO_ARCH_SAM
ARDUINO_ARCH_SAMD
ARDUINO_ARCH_AVR
ARDUINO_ARCH_ESP8266