From 516c9a744d0bf2e6e0b299635ca3bc90bc56461e Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Mon, 9 Dec 2024 18:48:49 -0300 Subject: [PATCH 1/2] feat(arduino): adds boot pin constant for all esp32 soc --- cores/esp32/esp32-hal.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cores/esp32/esp32-hal.h b/cores/esp32/esp32-hal.h index d80bf2f15de..a0f0ac09729 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 HSoC 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 From 492fc7cfb5276a13f0f905d3d38d829a70682f6a Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Mon, 9 Dec 2024 18:56:45 -0300 Subject: [PATCH 2/2] fix(arduino): spacing and commentary error --- cores/esp32/esp32-hal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp32/esp32-hal.h b/cores/esp32/esp32-hal.h index a0f0ac09729..31db2354a8f 100644 --- a/cores/esp32/esp32-hal.h +++ b/cores/esp32/esp32-hal.h @@ -141,7 +141,7 @@ const uint8_t BOOT_PIN = 0; #elif CONFIG_IDF_TARGET_ESP32P4 const uint8_t BOOT_PIN = 35; #else -// All other series C and HSoC use GPIO 9 as BOOT PIN +// All other series C and H SoC use GPIO 9 as BOOT PIN const uint8_t BOOT_PIN = 9; #endif