Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/sleep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,14 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false, bool skipSaveN
pinMode(I2C_SCL, ANALOG);
#endif

#ifdef ARCH_ESP32
// gpio_hold_en alone only retains pin state during light sleep on ESP32;
// for the holds to apply during deep sleep the global enable must be
// armed once before esp_deep_sleep_start. Without this, BUTTON_PIN and
// LORA_CS float in DSLP and can leak current or trigger spurious activity.
gpio_deep_sleep_hold_en();
#endif

console->flush();
cpuDeepSleep(msecToWake);
}
Expand Down