-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
esp32 port: expose adjtime(3) as utime.adjtime([(sec,usec)]) #5453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/API/ESP-IDF/ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.