enviro icon indicating copy to clipboard operation
enviro copied to clipboard

Fixed crash on cold RTC boot

Open thinkier opened this issue 2 years ago • 2 comments

Added checks before writing external RTC time to Pico's time to prevent error-crash when the enviro board is booted from a cold RTC.

thinkier avatar Dec 15 '22 04:12 thinkier

Hi. Do you have more details of the crash you experienced? From a cold boot the RTC does have a time (though out by 2 years), so shouldn't cause a crash when being applied to the Pico's RTC.

ZodiusInfuser avatar Dec 15 '22 10:12 ZodiusInfuser

When I unboxed my enviro urban, the dRTC kept trying to set the time on the Pico's RTC to something in 2001 and immediately crashes. This fix attempts to fetch NTP time if the dRTC is ridiculously off (as defined by an existing function; where the dRTC reports the year to be 2020)

thinkier avatar Dec 17 '22 04:12 thinkier