diff --git a/cores/esp32/esp32-hal.h b/cores/esp32/esp32-hal.h index d80bf2f15de..31db2354a8f 100644 --- a/cores/esp32/esp32-hal.h +++ b/cores/esp32/esp32-hal.h @@ -135,6 +135,18 @@ void arduino_phy_init(); void initArduino(); #endif +// defines a constant that can be used to map BOOT pin for each different ESP32 SoC +#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 +const uint8_t BOOT_PIN = 0; +#elif CONFIG_IDF_TARGET_ESP32P4 +const uint8_t BOOT_PIN = 35; +#else +// All other series C and H SoC use GPIO 9 as BOOT PIN +const uint8_t BOOT_PIN = 9; +#endif + + + typedef struct { int core; // core which triggered panic const char *reason; // exception string