I have a program that I want to run on either a Redboard Turbo or an Arduino Leonardo. I added #if defined () complier directives to conditionally compile board specific code. For the Leonardo the name is ARDUINO_AVR_LEONARDO. What is the equivalent name for the Redboard Turbo?
Try ARDUINO_SAMD_REDBOARD_TURBO and test.
That didn’t work. I just created my own local defines for the Redboard Turbo and Leonardo rather than relying on the define created by Arduino based on the board selected. Just means I need to uncomment one of the other whenever I switch boards.
Thanks for the reply.
Tom
Hi Tom,
The RedBoard Turbo mimics the Arduino Zero:
ARDUINO_ARCH_SAMD
ARDUINO_SAMD_ZERO
I hope this helps,
Paul
Paul,
Thanks, The both worked. Do you know where these get defined?
Tom
Hi Tom,
That’s a good question.
It’s partly defined by the board package boards.txt
:
The rest is almost certainly inherited from the Arduino SAMD core and the gcc compiler directives.
I hope this helps,
Paul