Skip to content

Commit 516c9a7

Browse files
authored
feat(arduino): adds boot pin constant for all esp32 soc
1 parent cd772f1 commit 516c9a7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cores/esp32/esp32-hal.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ void arduino_phy_init();
135135
void initArduino();
136136
#endif
137137

138+
// defines a constant that can be used to map BOOT pin for each different ESP32 SoC
139+
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
140+
const uint8_t BOOT_PIN = 0;
141+
#elif CONFIG_IDF_TARGET_ESP32P4
142+
const uint8_t BOOT_PIN = 35;
143+
#else
144+
// All other series C and HSoC use GPIO 9 as BOOT PIN
145+
const uint8_t BOOT_PIN = 9;
146+
#endif
147+
148+
149+
138150
typedef struct {
139151
int core; // core which triggered panic
140152
const char *reason; // exception string

0 commit comments

Comments
 (0)