Naguissa / uRTCLib

Really tiny library to basic RTC functionality on Arduino. DS1307, DS3231 and DS3232 RTCs are supported.
https://www.foroelectro.net/librerias-arduino-ide-f29/rtclib-arduino-libreria-simple-y-eficaz-para-rtc-y-t95.html
GNU Lesser General Public License v3.0
87 stars 24 forks source link

Add error checking to refresh() #36

Closed BenUniqcode closed 4 months ago

BenUniqcode commented 5 months ago

Return type of refresh() changed from void to bool. Returns false if no response was received, or fewer than the expected number of bytes of response for the selected model; otherwise true.

This enables the caller to check whether the RTC could be successfully contacted, before going ahead and using it. Without it, all we can do is blindly assume that it's present and working, which can result in (a) nonsense values being used and (b) long delays while the I2C bus gives repeated errors.