Skip to content

Commit 2b98c24

Browse files
committed
Bugfix: ds3231 weekday is 1-index
1 parent f3c8d37 commit 2b98c24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sixtube_lm/sixtube_lm.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ void ctrlEvt(byte ctrl, byte evt){
340340
ds3231.setYear(fnSetValDate[0]%100); //TODO: do we store century on our end? Per ds3231 docs, "The century bit (bit 7 of the month register) is toggled when the years register overflows from 99 to 00."
341341
ds3231.setMonth(fnSetValDate[1]);
342342
ds3231.setDate(fnSetVal);
343-
ds3231.setDoW(dayOfWeek(fnSetValDate[0],fnSetValDate[1],fnSetVal));
343+
ds3231.setDoW(dayOfWeek(fnSetValDate[0],fnSetValDate[1],fnSetVal)+1); //ds3231 weekday is 1-index
344344
clearSet(); break;
345345
default: break;
346346
} break;
@@ -555,7 +555,7 @@ void checkRTC(bool force){
555555
}
556556
//Update things based on RTC
557557
tod = rtc.now();
558-
toddow = ds3231.getDoW();
558+
toddow = ds3231.getDoW()-1; //ds3231 weekday is 1-index
559559

560560
if(rtcSecLast != tod.second() || force) {
561561
rtcSecLast = tod.second();

0 commit comments

Comments
 (0)