Skip to content

Commit 10d0b42

Browse files
author
Jim Lindblom
authored
Merge pull request #2 from ws0w/master
Fix bug in update that masked 2s from the tens digit for hours.
2 parents 377e67f + 7ece12b commit 10d0b42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SparkFunDS1307RTC.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ bool DS1307::update(void)
162162
_pm = true;
163163
else
164164
_pm = false;
165+
_time[TIME_HOURS] &= 0x1F; // Mask out 24-hour bit from hours
165166
}
166-
_time[TIME_HOURS] &= 0x1F; // Mask out 24-hour bit from hours
167167

168168
return true;
169169
}
@@ -496,4 +496,4 @@ bool DS1307::i2cReadBytes(uint8_t deviceAddress, ds1307_registers reg, uint8_t *
496496
return true;
497497
}
498498

499-
DS1307 rtc; // Use rtc in sketches
499+
DS1307 rtc; // Use rtc in sketches

0 commit comments

Comments
 (0)