1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Added support for RTC user memory in ESP-specific APIs. (#1836)

This commit is contained in:
Macro Yau
2016-06-01 11:13:33 +08:00
committed by Ivan Grokhotkov
parent 974b9ae2fa
commit 2a4081b079
4 changed files with 75 additions and 0 deletions

View File

@ -83,6 +83,8 @@ APIs related to deep sleep and watchdog timer are available in the `ESP` object,
`ESP.deepSleep(microseconds, mode)` will put the chip into deep sleep. `mode` is one of `WAKE_RF_DEFAULT`, `WAKE_RFCAL`, `WAKE_NO_RFCAL`, `WAKE_RF_DISABLED`. (GPIO16 needs to be tied to RST to wake from deepSleep.)
`ESP.rtcUserMemoryWrite(&data, sizeof(data))` and `ESP.rtcUserMemoryRead(&data, sizeof(data))` allow struct data with the maximum size of 512 bytes to be stored and retrieved from the RTC user memory of the chip respectively. The stored data can be retained between deep sleep cycles. However, the data might be lost after power cycling the chip.
`ESP.restart()` restarts the CPU.
`ESP.getResetReason()` returns String containing the last reset resaon in human readable format.