pimoroni / enviro

MIT License
101 stars 79 forks source link

RTC and Adafruit IO related improvements #132

Closed ZodiusInfuser closed 1 year ago

ZodiusInfuser commented 1 year ago

Adafruit IO destination now specifically checks for the "data in the future" error, and if encountered triggers an RTC resync on the next boot.

To achieve this, the boards now write a file upon RTC sync with the time of that sync. This file is used in addition to the previous "year 2020 or before" to trigger a resync. For instance, if the file is missing or deleted (as is done with this Adafruit IO case), then a resync is forced. Additionally, a resync is triggered after a user defined number of hours. By default this is set to 1 week.

Additionally, this PR fixes two other minor issues with the RTC: