What are compiler board names for M0 Express & M4 Airlift Lite?

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
MonsignorBart
 
Posts: 27
Joined: Sun Dec 29, 2019 4:33 pm

What are compiler board names for M0 Express & M4 Airlift Lite?

Post by MonsignorBart »

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!

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: What are compiler board names for M0 Express & M4 Airlift Lite?

Post by mikeysklar »

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.

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
Your code should look like:

Code: Select all

#if defined (SAMD_FEATHER_M0_EXPRESS)
...
#elif (METRO_M4)
....
#endif

User avatar
MonsignorBart
 
Posts: 27
Joined: Sun Dec 29, 2019 4:33 pm

Re: What are compiler board names for M0 Express & M4 Airlift Lite?

Post by MonsignorBart »

Thank you!

Locked
Please be positive and constructive with your questions and comments.

Return to “Metro, Metro Express, and Grand Central Boards”