sqfmi / Watchy

Watchy - An Open Source E-Ink Smartwatch
http://www.sqfmi.com
MIT License
2k stars 334 forks source link

**BUG** WatchyRTC adding 1 to weekday on PCF8563 only. #124

Closed GuruSR closed 2 years ago

GuruSR commented 2 years ago

WatchyRTC::read: tm.Wday = rtc_pcf.getWeekday() + 1;

The + 1 needs to be removed as Sunday is 0, the DS3231 returns 0 for Sunday, using this + 1 puts Sunday to 1 on the PCF8563, which equates to Monday on the DS3231.

Also, please flag the PCF8563 to use 1900 year instead of 2000 to avoid any weekday weirdness when using NTP data.

IF the PCF8563 is set to use 1900, it can also lose the +/- 30, since both RTCs will be set using the 1900 year offset from NTP data.