User Tools

Site Tools


esp:esp32:esp-idf-info:conditional-compile

This is an old revision of the document!


Compiler defines

To set specific compile time defines (e.g. in case of compiling a project for different architectures esp32, esp32-c3, etc.) do the following:

in the c source files include conditional statements

#ifdef __GPIO_ESP_DEVKIT_WROOM
   .....
#endif
#ifdef __GPIO_ESP_C3_MINI
   .....
#endif

In project/main/CMakelists.txt add at the bottom:

add_compile_definitions( __GPIO_ESP_DEVKIT_WROOM=1)
or
add_compile_definitions( __GPIO_ESP_C3_MINI=1)
esp/esp32/esp-idf-info/conditional-compile.1739086839.txt.gz · Last modified: by oscar