Hello,
I'm try to find the C preprocessor symbol defined to identify the ItsyBitsy M4 hardware (using Arduino IDE).
When compiling for the Feather M0 Express, symbol ARDUINO_SAMD_FEATHER_M0_EXPRESS is defined and can be tested.
What would be the equivalent for ItsyBitsy M4? I tried ARDUINO_SAMD_ITSYBITSY_M4 and ARDUINO_SAMD_ITSYBITSY_M4_EXPRESS, ADAFRUIT_SAMD_ITSYBITSY_M4 and ADAFRUIT_SAMD_ITSYBITSY_M4_EXPRESS but none of them seem to be defined...
I detected a _VARIANT_ITSYBITSY_M4 in one of the core files, but it doesn't seem to be defined either.
Thanks for your clarifications!
Alain.
PS: more generally, where can I find this information for other Adafruit boards?
cpp symbol for ItsyBitsy M4
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: cpp symbol for ItsyBitsy M4
This github repo contains boards.txt:
https://github.com/adafruit/ArduinoCore-samd
https://github.com/adafruit/ArduinoCore-samd
Code: Select all
$ grep -i itsybitsy boards.txt | grep board
adafruit_itsybitsy_m0.build.board=ITSYBITSY_M0
adafruit_itsybitsy_m4.build.board=ITSYBITSY_M4
- AlainB
- Posts: 26
- Joined: Sat Jul 07, 2018 7:28 am
Re: cpp symbol for ItsyBitsy M4
That was fast... Thanks a lot! :-)
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: cpp symbol for ItsyBitsy M4
You pretty much guess the right name. Just need an underscore.
- AlainB
- Posts: 26
- Joined: Sat Jul 07, 2018 7:28 am
Re: cpp symbol for ItsyBitsy M4
Mmmh, I'm afraid that's not the symbol I'm looking for,.. I think the symbol should be defined somewhere in a header file I cannot locate, and that it probably is not that easy to guess, after all... :-)
Let's compile this sketch:
I get this when compiling for Feather M0 Express, which is as expected (symbol ARDUINO_SAMD_FEATHER_M0_EXPRESS is defined):
When compiling for ItsyBitsyM4, I get this (the ITSYBITSY_M4 symbol is clearly not defined, so which one is??):
Sorry to inconvenience...
Alain.
Let's compile this sketch:
Code: Select all
#include "Arduino.h"
#ifdef ARDUINO_SAMD_FEATHER_M0_EXPRESS
#error Feather M0 express
#else
#error not Feather M0 express
#endif
#ifdef ITSYBITSY_M4
#error M4
#else
#error not M4
#endif
void setup() {}
void loop() {}
Code: Select all
~/Documents/Arduino/cansat-asgard/personal/baudhuin/TestItsyBitsyM4 >arduino-cli compile --fqbn adafruit:samd:adafruit_feather_m0_express
/Users/Alain/Documents/Arduino/cansat-asgard/personal/baudhuin/TestItsyBitsyM4/TestItsyBitsyM4.ino:6:2:
#errror Feather M0 express
^
/Users/Alain/Documents/Arduino/cansat-asgard/personal/baudhuin/TestItsyBitsyM4/TestItsyBitsyM4.ino:14:2: error: #error not M4
#error not M4
^
Error during build: exit status 1
Code: Select all
~/Documents/Arduino/cansat-asgard/personal/baudhuin/TestItsyBitsyM4 >arduino-cli compile --fqbn adafruit:samd:adafruit_itsybitsy_m4
/Users/Alain/Documents/Arduino/cansat-asgard/personal/baudhuin/TestItsyBitsyM4/TestItsyBitsyM4.ino:8:2: error: #error not Feather M0 express
#error not Feather M0 express
^
/Users/Alain/Documents/Arduino/cansat-asgard/personal/baudhuin/TestItsyBitsyM4/TestItsyBitsyM4.ino:14:2: error: #error not M4
#error not M4
^
Error during build: exit status 1
Alain.
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: cpp symbol for ItsyBitsy M4
my bad....brute force google searching turned this up:
Code: Select all
ARDUINO_ITSYBITSY_M4
- AlainB
- Posts: 26
- Joined: Sat Jul 07, 2018 7:28 am
Re: cpp symbol for ItsyBitsy M4
That's the one!
Your brute force search is definetely better than mine.
Issue closed, thanks!
Your brute force search is definetely better than mine.
Issue closed, thanks!
Please be positive and constructive with your questions and comments.