fbiego / ESP32Time

An Arduino library for setting and retrieving internal RTC time on ESP32 boards
MIT License
212 stars 36 forks source link

If a date after 2036 is set by mistake, the correct date cannot be reset #30

Closed lovyan03 closed 1 year ago

lovyan03 commented 1 year ago

Hello! Thanks for publishing this library.

I noticed that if I setTime for a date after 2036 by mistake, the overflow flag is not cleared even if I set the correct date again. In this case, the system must be reset to restore it. Is it necessary to set this->overflow = false in a line97 within the setTime function?

https://github.com/fbiego/ESP32Time/blob/548dfd385c961589aa95384a689422c0481283c7/ESP32Time.cpp#L93-L98

Again thank you for your work.

fbiego commented 1 year ago

thanks for pointing this out, yes it would be necessary to reset the overflow flag