Fix immediate wake from deepsleep for some devices (#3884)

Affects ESP32 boards without an external pull-up on the defined user-button pin.
This commit is contained in:
todd-herbert
2024-05-14 06:46:03 -05:00
committed by GitHub
co-authored by GitHub
parent a9a208de73
commit 2388eb91ae
+4
View File
@@ -264,7 +264,11 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false)
#ifdef BUTTON_PIN
// Avoid leakage through button pin
if (GPIO_IS_VALID_OUTPUT_GPIO(BUTTON_PIN)) {
#ifdef BUTTON_NEED_PULLUP
pinMode(BUTTON_PIN, INPUT_PULLUP);
#else
pinMode(BUTTON_PIN, INPUT);
#endif
gpio_hold_en((gpio_num_t)BUTTON_PIN);
}
#endif