bugfix: 修复rtc时钟对BCD码进行转换的时候,忘了处理day字段的问题 (#104)

This commit is contained in:
login 2022-12-11 22:59:47 +08:00 committed by GitHub
parent 237e95c6dd
commit 728aca3089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,7 @@ int rtc_get_cmos_time(struct rtc_time_t *t)
t->second = (t->second & 0xf) + (t->second >> 4) * 10;
t->minute = (t->minute & 0xf) + (t->minute >> 4) * 10;
t->hour = ((t->hour & 0xf) + ((t->hour & 0x70) >> 4) * 10) | (t->hour & 0x80);
t->day = (t->day & 0xf) + ((t->day / 16) * 10);
t->month = (t->month & 0xf) + (t->month >> 4) * 10;
t->year = (t->year & 0xf) + (t->year >> 4) * 10;
}