Wall clock APIs that avoid reprogramming the hardware calendar. More...
Functions | |
| uint64_t | tr_rtc_wallclock_ms_get (void) |
| Get the wall‑clock time (ms since 2000‑01‑01). | |
| void | tr_rtc_wallclock_ms_set (uint64_t ms_since_2000) |
| Set the wall‑clock (ms since 2000‑01‑01) using the offset model. | |
Wall clock APIs that avoid reprogramming the hardware calendar.
| uint64_t tr_rtc_wallclock_ms_get | ( | void | ) |
Get the wall‑clock time (ms since 2000‑01‑01).
Returns wall = now_ms + wallclock_offset. The offset lives in retention RAM, thus persists across deep‑sleep but is cleared on cold resets (power/external/watchdog). Use this if you need a “human time” representation without changing the hardware calendar.
| void tr_rtc_wallclock_ms_set | ( | uint64_t | ms_since_2000 | ) |
Set the wall‑clock (ms since 2000‑01‑01) using the offset model.
| [in] | ms_since_2000 | Desired wall‑clock time (ms since 2000‑01‑01). |
Computes and stores wallclock_offset = desired_ms - HW_now_ms. Subsequent tr_rtc_wallclock_ms_get() calls will return the desired timeline without touching the hardware calendar. The offset is stored in retention RAM.