From c087f1b549252c061f2ce31ec18afbdbc796047c Mon Sep 17 00:00:00 2001 From: Greg Date: Sat, 19 Feb 2022 18:22:10 +1030 Subject: [PATCH] Store DST setting in DS3232 SRAM Stores DST setting so it survives reboots of the tinyduino --- SCTVcode/SCTVcode.ino | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SCTVcode/SCTVcode.ino b/SCTVcode/SCTVcode.ino index e7d627a..7e2420b 100644 --- a/SCTVcode/SCTVcode.ino +++ b/SCTVcode/SCTVcode.ino @@ -342,6 +342,7 @@ void writeRTClocale() Wire.write(ZMins); Wire.write(Hr12); Wire.write(Hertz); + Wire.write(DST); Wire.endTransmission(); } @@ -381,13 +382,14 @@ void readRTClocale() Wire.write(0x18); // read locale data starting at byte 0x18 Wire.endTransmission(); - Wire.requestFrom(DS3232_ADDRESS, 6, 1); // request seven bytes, then stop + Wire.requestFrom(DS3232_ADDRESS, 7, 1); // request seven bytes, then stop if (Wire.read() == rtcMagic) { Century = Wire.read(); Zone = Wire.read() - 30; ZMins = Wire.read(); Hr12 = Wire.read(); Hertz = Wire.read(); + DST = Wire.read(); rtcValid = 1; } else { @@ -396,6 +398,7 @@ void readRTClocale() Wire.read(); Wire.read(); Wire.read(); + Wire.read(); rtcValid = 0; } }