I've spent a lot of time on this. Saw posts to look at the boards.txt file but I don't have any applicable boards.txt file in my Arduino\hardware directory. I have the M0 Express and M4 Airlift Lite and in my dev I use the M0 and for live I use the M4. I do some pwm work which requires me setting registers and they're different between the two. I'd like to use an #if defined(M0 Express)
// Use these register settings for pwm
#else
// Use the M4 Airlift Lite settings for pwm
#end
What are the compiler board names for the mentioned? I saw in the Arduino IDE that it says the M0 Express is ATSAMD21G18A but #if defined(ATSAMD21G18A) did not work. Thank you!
What are compiler board names for M0 Express & M4 Airlift Lite?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- MonsignorBart
- Posts: 27
- Joined: Sun Dec 29, 2019 4:33 pm
- mikeysklar
- Posts: 13946
- Joined: Mon Aug 01, 2016 8:10 pm
Re: What are compiler board names for M0 Express & M4 Airlift Lite?
The supplemental JSON file from the Feather M0 page is the place to start.
https://learn.adafruit.com/adafruit-fea ... roto/setup
https://adafruit.github.io/arduino-boar ... index.json
In the above JSON file you can download the bz2 file for your board model and look at the board.txt inside that.
Your code should look like:
https://learn.adafruit.com/adafruit-fea ... roto/setup
https://adafruit.github.io/arduino-boar ... index.json
In the above JSON file you can download the bz2 file for your board model and look at the board.txt inside that.
Code: Select all
$ grep express boards.txt | grep board
adafruit_feather_m0_express.build.board=SAMD_FEATHER_M0_EXPRESS
Code: Select all
grep m4 boards.txt | grep board
adafruit_metro_m4.build.board=METRO_M4
#adafruit_feather_m4.build.board=FEATHER_M4
Code: Select all
#if defined (SAMD_FEATHER_M0_EXPRESS)
...
#elif (METRO_M4)
....
#endif
- MonsignorBart
- Posts: 27
- Joined: Sun Dec 29, 2019 4:33 pm
Please be positive and constructive with your questions and comments.