Explorar o código

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

login %!s(int64=2) %!d(string=hai) anos
pai
achega
728aca3089
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      kernel/src/driver/timers/rtc/rtc.c

+ 1 - 1
kernel/src/driver/timers/rtc/rtc.c

@@ -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;
     }