RTC drivers fix (#259)

This commit is contained in:
Ruslan V. Uss 2016-11-01 15:40:19 +06:00 committed by sheinz
parent 8ef476c71f
commit 98de5e573a
3 changed files with 17 additions and 16 deletions

View file

@ -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 {