mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-28 04:05:39 +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:
@@ -85,3 +85,18 @@ void esp_brownout_init(void)
|
||||
brownout_hal_intr_enable(true);
|
||||
#endif // not SOC_BROWNOUT_RESET_SUPPORTED
|
||||
}
|
||||
|
||||
void esp_brownout_disable(void)
|
||||
{
|
||||
brownout_hal_config_t cfg = {
|
||||
.enabled = false,
|
||||
};
|
||||
|
||||
brownout_hal_config(&cfg);
|
||||
|
||||
#ifndef SOC_BROWNOUT_RESET_SUPPORTED
|
||||
brownout_hal_intr_enable(false);
|
||||
|
||||
rtc_isr_deregister(rtc_brownout_isr_handler, NULL);
|
||||
#endif // not SOC_BROWNOUT_RESET_SUPPORTED
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user