mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 10:40:47 +03:00
Merge branch 'fix/brownout_restore_after_deepsleep_reject_v6.0' into 'release/v6.0'
fix(esp_hw_support): restore brownout after deep sleep rejection on ESP32-S2 (v6.0) See merge request espressif/esp-idf!52647
This commit is contained in:
@@ -1180,12 +1180,11 @@ static esp_err_t FORCE_IRAM_ATTR deep_sleep_start(bool allow_sleep_rejection)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32S2
|
||||
#if CONFIG_IDF_TARGET_ESP32S2 && CONFIG_ESP_BROWNOUT_DET
|
||||
/* Due to hardware limitations, on S2 the brownout detector sometimes trigger during deep sleep
|
||||
to circumvent this we disable the brownout detector before sleeping */
|
||||
esp_brownout_disable();
|
||||
#endif //CONFIG_IDF_TARGET_ESP32S2
|
||||
#endif //CONFIG_IDF_TARGET_ESP32S2 && CONFIG_ESP_BROWNOUT_DET
|
||||
|
||||
esp_sync_timekeeping_timers();
|
||||
|
||||
@@ -1286,6 +1285,12 @@ static esp_err_t FORCE_IRAM_ATTR deep_sleep_start(bool allow_sleep_rejection)
|
||||
esp_int_wdt_livelock_workaround(true);
|
||||
#endif
|
||||
esp_os_exit_critical(&s_config.lock);
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32S2 && CONFIG_ESP_BROWNOUT_DET
|
||||
/* Brownout was disabled before attempting deep sleep; restore it after rejection. */
|
||||
esp_brownout_init();
|
||||
#endif //CONFIG_IDF_TARGET_ESP32S2 && CONFIG_ESP_BROWNOUT_DET
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user