Clear stale wakeup sources to avoid ghost wakeup

This commit is contained in:
Kevin Le
2026-04-25 23:38:38 +07:00
parent a44137662e
commit aa400da945
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -53,6 +53,10 @@ public:
}
void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1) {
// Clear stale wakeup sources to avoid ghost wakeup
// This is required when Power Management and automatic lightsleep are enabled
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL);
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
// Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep
+4
View File
@@ -33,6 +33,10 @@ void HeltecV4Board::begin() {
}
void HeltecV4Board::enterDeepSleep(uint32_t secs, int pin_wake_btn) {
// Clear stale wakeup sources to avoid ghost wakeup
// This is required when Power Management and automatic lightsleep are enabled
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL);
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
// Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep