Works from 1900+ on both RTCs.

Identical operation on BOTH RTCs.
pull/126/head
GuruSR 2021-12-26 23:08:21 -05:00 committed by GitHub
parent c0466ae9f1
commit 4f342f2f42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,11 @@
#define PCF8563 1
#define RTC_DS_ADDR 0x68
#define RTC_PCF_ADDR 0x51
#define RTC_YEAR_OFFSET 1900 // Use for calculation to display year properly.
#define RTC_CENTURY_OFFSET 100 // Short Year offset.
#define RTC_1900TO1970 2208988800UL // Subtract from NTP to get Epoch.
#define RTC_1970TO2000 946684800UL // Subtract from Epoch to get Y2k.
#define RTC_1900TO2000 (RTC_1900TO1970 + RTC_1970TO2000) // Subtract from NTP to get Y2k.
class WatchyRTC {
public:
@ -22,7 +27,6 @@ class WatchyRTC {
void read(tmElements_t &tm);
void set(tmElements_t tm);
uint8_t temperature();
time_t NTPCorrection(time_t FromNTP);
private:
void _DSConfig(String datetime);
void _PCFConfig(String datetime);