mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
esp8266: Let RTC work correctly after deepsleep.
By design, at wake up from deepsleep, the RTC timer will be reset, but the data stored in RTC memory will not [1]. Therefore, we have to adjust delta in RTC memory before going into deepsleep to get almost correct time after waking up. [1] http://bbs.espressif.com/viewtopic.php?t=1184#p4082
This commit is contained in:
@@ -103,6 +103,8 @@ STATIC mp_obj_t machine_deepsleep(void) {
|
||||
}
|
||||
}
|
||||
|
||||
// prepare for RTC reset at wake up
|
||||
rtc_prepare_deepsleep(sleep_us);
|
||||
// put the device in a deep-sleep state
|
||||
system_deep_sleep_set_option(0); // default power down mode; TODO check this
|
||||
system_deep_sleep(sleep_us);
|
||||
|
||||
Reference in New Issue
Block a user