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:
The RTC not always getting set when a resync occurred
The RTC alarm time being set to the exact second the board goes to sleep, thus never waking up
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: