board_android-IoT/arduino_esp8266_esp32

Conditional compile for ESP32 and ESP32S3

cskimair 2024. 11. 16. 13:08

 

 

// Source code in Arduino IDE 
#ifdef CONFIG_IDF_TARGET_ESP32
#warning  "[ESP32]"
#elif CONFIG_IDF_TARGET_ESP32S3
#warning "[ESP32S3]"
#endif 

1. if select ESP32 
> compile result: 
....: warning: #warning "[ESP32]" [-Wcpp]
 #warning  "[ESP32]"
  ^~~~~~~

2. if select ESP32S3 
- In arduino IDE, Menu: Tools-> Board -> ESP32 -> ESP32S3  

...warning: #warning "[ESP32S3]" [-Wcpp]
 #warning "[ESP32S3]"
  ^~~~~~~
 

Reference:

https://community.platformio.org/t/what-is-the-specific-if-defined-arduino-arch-esp32-for-esp32-s2-esp32-s3-esp32-c3/33833

 

What is the specific #if defined(ARDUINO_ARCH_ESP32) for ESP32-S2, ESP32-S3, ESP32-C3?

as title. what is the specific #if defined(ARDUINO_ARCH_ESP32) for ESP32-S2, ESP32-S3, ESP32-C3? I want to do something only if ESP32-S2 is used for example.

community.platformio.org