Skip to content

Commit 9660e66

Browse files
authored
feat(chip): Add definition for BOOT_PIN for all chips (#10700)
* feat(chip): Add definition for BOOT_PIN for all chips For use in sketches as default button * fix(core): Make BOOT_PIN static * fix(hal): BOOT_PIN should always be defined
1 parent 538efe3 commit 9660e66

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cores/esp32/esp32-hal.h

+13
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,19 @@ extern "C" {
6161
#define ARDUINO_EVENT_RUNNING_CORE CONFIG_ARDUINO_EVENT_RUNNING_CORE
6262
#endif
6363

64+
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
65+
static const uint8_t BOOT_PIN = 0;
66+
#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32C61
67+
static const uint8_t BOOT_PIN = 9;
68+
#elif CONFIG_IDF_TARGET_ESP32P4
69+
static const uint8_t BOOT_PIN = 35;
70+
#elif CONFIG_IDF_TARGET_ESP32C5
71+
static const uint8_t BOOT_PIN = 28;
72+
#else
73+
#error BOOT_PIN not defined for this chip!
74+
#endif
75+
#define BOOT_PIN BOOT_PIN
76+
6477
//forward declaration from freertos/portmacro.h
6578
void vPortYield(void);
6679
void yield(void);

0 commit comments

Comments
 (0)