esp32 port: expose adjtime(3) as utime.adjtime([(sec,usec)])#5453
esp32 port: expose adjtime(3) as utime.adjtime([(sec,usec)])#5453wieck wants to merge 3 commits into
Conversation
|
Discussion at https://forum.micropython.org/viewtopic.php?f=18&t=7403 |
utime.adjtime() can be used to slew the system clock by a given adjustment value (as an optional (sec, usec) tuple). The system clock is not abruptly changed, but gradually adjusts the boot time. The call immediately returns, but a correction by 1 second will actually take 64 seconds in the background. The system clock remains monotonic during this time but will appear faster/slower. Called without an argument or None it will return the remaining adjustment from a previous call. If called with an adjustment value a previously running adjustment is cancelled without being undone.
|
IMHO this needs a doc update commit. Would love to see it merged then! 👍 |
tve
left a comment
There was a problem hiding this comment.
Cool! I assume this is still worth merging? I don't remember your last experiences with the clock stuff, I believe you were not convinced on the adjtime on the esp8266 but OK on the esp32, right?
|
|
||
| .. function:: adjtime([(secs, usecs)]) | ||
|
|
||
| This function is only available in the esp32 port. It uses the API's |
There was a problem hiding this comment.
mind fixing this? there are many APIs around whereas saying "the ESP-IDF's function" is unambiguous...
|
There is no adjtime(3) in the ESP8266 IDF. As stated in the other (closed) pull request, that port needs mor work. This one I still think is worth merging. |
|
This function can't be added to the If we were to add this (it does look useful!) then it could go in either |
utime.adjtime() can be used to slew the system clock by a
given adjustment value (as an optional (sec, usec) tuple).
The system clock is not abruptly changed, but gradually
adjusts the boot time. The call immediately returns, but
a correction by 1 second will actually take 64 seconds in
the background. The system clock remains monotonic during
this time but will appear faster/slower. Called without
an argument or None it will return the remaining adjustment
from a previous call. If called with an adjustment value a
previously running adjustment is cancelled without being
undone.