RTC drivers fix

This commit is contained in:
UncleRus 2016-11-01 00:40:03 +05:00
parent 5a14ab31e4
commit ff279296bf
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 {