10000 esp32 port: expose adjtime(3) as utime.adjtime([(sec,usec)]) by wieck · Pull Request #5453 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
wants to merge 3 commits into from
Closed

esp32 port: expose adjtime(3) as utime.adjtime([(sec,usec)]) #5453

wants to merge 3 commits into from

Conversation

wieck
Copy link
@wieck wieck commented Dec 25, 2019

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.

@wieck
Copy link
Author
wieck commented Dec 25, 2019

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.
@tve
Copy link
Contributor
tve commented Jan 9, 2020

IMHO this needs a doc update commit. Would love to see it merged then! 👍

Copy link
Contributor
@tve tve left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/API/ESP-IDF/ ?

Copy link
Contributor

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...

@wieck
Copy link
Author
wieck commented Feb 6, 2020

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.

@dpgeorge
Copy link
Member
dpgeorge commented Sep 5, 2023

This function can't be added to the time module because it's not in CPython.

If we were to add this (it does look useful!) then it could go in either machine.RTC.adjtime() (or maybe esp32.adjtime()).

@dpgeorge dpgeorge closed this Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0