Closed TomD53 closed 2 years ago
More helpful resources:
https://forum.pjrc.com/threads/61665-RTC-Registers-and-Millisecond-Precision-from-Teensy-4-0
Page 1242 of IMXRT1060 manual https://www.pjrc.com/teensy/IMXRT1060RM_rev2.pdf
Added rtc function in commit 1bb59a4dd402891d981d63303eafd27b0c87d70b
I don't believe it was actually using the Teensy RTC to sync the time; I left it running for an hour or two and there was some drift. Should be fixed in 7749812.
Based on this example code
The default interval for re-syncing the time is 5 minutes but can be changed by calling the
setSyncInterval(interval)
method to set the number of seconds between re-sync attempts.
https://forum.pjrc.com/threads/68062-Teensy-4-1-RTC-get-milliseconds-correctly
The above forum thread describes a method of getting a timestamp in milliseconds. Please write a function for this and place it in the
lib
folder. Then write a unit test for the function and place it in thetest
folder.The docs for unit testing in PIO are here, if you need help please message me on discord https://docs.platformio.org/en/stable/plus/unit-testing.html