RTC drivers fix (#259)
This commit is contained in:
parent
8ef476c71f
commit
98de5e573a
3 changed files with 17 additions and 16 deletions
|
@ -270,7 +270,7 @@ bool ds3231_getTime(struct tm *time)
|
|||
time->tm_min = bcdToDec(data[1]);
|
||||
if (data[2] & DS3231_12HOUR_FLAG) {
|
||||
/* 12H */
|
||||
time->tm_hour = bcdToDec(data[2] & DS3231_12HOUR_MASK);
|
||||
time->tm_hour = bcdToDec(data[2] & DS3231_12HOUR_MASK) - 1;
|
||||
/* AM/PM? */
|
||||
if (data[2] & DS3231_PM_FLAG) time->tm_hour += 12;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue