-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
STM: monotonic time even when RTC is changed #7965
Conversation
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.
makes sense, didn't test.
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.
This fixes #7808 from my tests on a Feather STM32F405 Express.
Thanks !
I need to look at this again. I didn't notice time is going backwards slightly here: >>> print(time.monotonic_ns()); r.datetime = time.struct_time((2022,1,1,0,0,0,0,0,0)); print(time.monotonic_ns())
1353792083741
1353791992187 |
>>> print(time.monotonic_ns()); r.datetime = time.struct_time((2022,1,1,0,0,0,0,0,0)); print(time.monotonic_ns())
35930114752
35930236824 I am not so fond of the STM32 RTC peripheral. |
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.
Thank you!
As per Issue adafruit#7965, this class does not work on the Unix build.
Test:
I also tested after ctrl-D: time.monotonic() is not reset to zero, which I think is OK.
The change looks bigger than it is: I had to reorder some things to avoid a forward declaration.