From 3e8921a0ed72521134a5c6cf5cd462576298cbc1 Mon Sep 17 00:00:00 2001 From: GuruSR Date: Tue, 23 Nov 2021 23:07:54 -0500 Subject: [PATCH] Changes to read and write, plus alarm functions. --- PCF8563/Library/PCF8563.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PCF8563/Library/PCF8563.cpp b/PCF8563/Library/PCF8563.cpp index 50eb2ca..f3d2baa 100644 --- a/PCF8563/Library/PCF8563.cpp +++ b/PCF8563/Library/PCF8563.cpp @@ -641,9 +641,7 @@ byte PCF8563::read(tmElements_t &tm) // Returns the I2C status (zero if successful). byte PCF8563::write(tmElements_t &tm) { - tmElements_t T = tm; - T.Year -= TIME_H_DIFF; // Take the extra 30 years off when using this function. - setDateTime(T.Day, T.Wday, T.Month, 0, T.Year, T.Hour, T.Minute, T.Second); + setDateTime(tm.Day, tm.Wday, tm.Month, false, tm.Year - TIME_H_DIFF, tm.Hour, tm.Minute, tm.Second); return 0; }