Determine Board Type #6583
-
I have a code base targeted for two different ESP32 boards. I need to conditionally compile certain sections depending on the target. How can I tell which board is selected in the Arduino Boards Manager, and can that be used for a series of #ifdef conditions? Or is there a different/better way? Arduino IDE 1.8.19 Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Many thanks to @atanisoft & miraculix200 over on Gitter for solving this one. Their answers: Miraculix200 Mike Dunston @atanisoft Line 52 in 6cfe461 |
Beta Was this translation helpful? Give feedback.
Many thanks to @atanisoft & miraculix200 over on Gitter for solving this one. Their answers:
Miraculix200
have a look at https://github.com/espressif/esp-idf/blob/master/examples/wifi/power_save/main/power_save.c#L98
while it says CONFIG_IDFTARGET* it will also work in Arduino
Mike Dunston @atanisoft
If you are targeting to ESP32 (not S2/S3/C3) boards that are listed in boards.txt you can use the value after the = on lines like this:
arduino-esp32/boards.txt
Line 52 in 6cfe461