mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-02 11:55:56 +00:00
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:
parent
a9a208de73
commit
2388eb91ae
@ -264,7 +264,11 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false)
|
|||||||
#ifdef BUTTON_PIN
|
#ifdef BUTTON_PIN
|
||||||
// Avoid leakage through button pin
|
// Avoid leakage through button pin
|
||||||
if (GPIO_IS_VALID_OUTPUT_GPIO(BUTTON_PIN)) {
|
if (GPIO_IS_VALID_OUTPUT_GPIO(BUTTON_PIN)) {
|
||||||
|
#ifdef BUTTON_NEED_PULLUP
|
||||||
|
pinMode(BUTTON_PIN, INPUT_PULLUP);
|
||||||
|
#else
|
||||||
pinMode(BUTTON_PIN, INPUT);
|
pinMode(BUTTON_PIN, INPUT);
|
||||||
|
#endif
|
||||||
gpio_hold_en((gpio_num_t)BUTTON_PIN);
|
gpio_hold_en((gpio_num_t)BUTTON_PIN);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user