8000 Merge remote-tracking branch 'origin/main' into main · alexbartlow/circuitpython@c53155c · GitHub
[go: up one dir, main page]

Skip to content

Commit c53155c

Browse files
committed
Merge remote-tracking branch 'origin/main' into main
2 parents fd3f570 + 5ba28e9 commit c53155c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ports/esp32s2/common-hal/alarm/__init__.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *ala
150150
void NORETURN alarm_enter_deep_sleep(void) {
151151
alarm_pin_pinalarm_prepare_for_deep_sleep();
152152
alarm_touch_touchalarm_prepare_for_deep_sleep();
153+
154+
// Disable brownout detection, which appears to be triggered sometimes when
155+
// waking from deep sleep.
156+
// See https://www.esp32.com/viewtopic.php?f=13&t=19208#p71084
157+
// and https://github.com/adafruit/circuitpython/issues/4025#issuecomment-771027606
158+
// TODO: We can remove this workaround when ESP-IDF handles this.
159+
CLEAR_PERI_REG_MASK(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_RST_ENA);
160+
153161
// The ESP-IDF caches the deep sleep settings and applies them before sleep.
154162
// We don't need to worry about resetting them in the interim.
155163
esp_deep_sleep_start();

0 commit comments

Comments
 (0)
0