mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-22 18:38:37 +00:00
deep_sleep: on S2 disable the brown out detector before deep sleeping
On S2 the brown out detector would occasionally trigger erroneously during deep sleep. Disable it before sleeping to circumvent this issue. Closes https://github.com/espressif/esp-idf/issues/6179
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
#include "esp32s2/clk.h"
|
||||
#include "esp32s2/rom/cache.h"
|
||||
#include "esp32s2/rom/rtc.h"
|
||||
#include "esp32s2/brownout.h"
|
||||
#include "soc/extmem_reg.h"
|
||||
#include "driver/gpio.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||
@@ -588,6 +589,12 @@ inline static uint32_t IRAM_ATTR call_rtc_sleep_start(uint32_t reject_triggers)
|
||||
|
||||
void IRAM_ATTR esp_deep_sleep_start(void)
|
||||
{
|
||||
#if CONFIG_IDF_TARGET_ESP32S2
|
||||
/* 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
|
||||
|
||||
// record current RTC time
|
||||
s_config.rtc_ticks_at_sleep_start = rtc_time_get();
|
||||
|
||||
|
Reference in New Issue
Block a user