There is no way to get a monotonic timestamp
Currently, there is no way to get a monotonically increasing timestamp resistant to updates of the system RTC. This is especially needed when making a button-based interface for changing the RTC.
A monotonic time library can almost be implemented in user software, but not quite:
-
utime.set_time
does not allow to set milliseconds, always resetting them to 0 - updates to the time via BLE will not be picked up by user software and will cause the "monotonic" time to jump
This would need to be implemented in firmware to be reliable.
Proposed pycardium function names:
utime.time_monotonic()
-
utime.time_monotonic_ms()
(alternatively:utime.time_ms_monotonic()
)
I don't know where in the firmware setting the time via BLE happens, so I don't know if having a "monotonic" wrapper in pycardium would suffice, or if it would need to be in epicardium for that to be accounted for.