This commit is contained in:
Linehu
2026-08-09 22:20:01 +08:00
parent 8717ea8f20
commit 2a50fa58c7
185 changed files with 19890 additions and 710 deletions
+20
View File
@@ -0,0 +1,20 @@
/* deshab/rtc.h - CMOS RTC 时钟读取
*
* 整合 desktop_app.h 的 da_rtc_time。读取 CMOS RTC 时/分(BCD -> 二进制)。
*/
#ifndef DESHAB_RTC_H
#define DESHAB_RTC_H
#include "types.h"
#include "portio.h"
static inline void dsb_rtc_time(u8 *h, u8 *m) {
dsb_outb(0x70, 4);
*h = dsb_inb(0x71);
dsb_outb(0x70, 2);
*m = dsb_inb(0x71);
*h = (u8)((*h >> 4) * 10 + (*h & 0xF));
*m = (u8)((*m >> 4) * 10 + (*m & 0xF));
}
#endif /* DESHAB_RTC_H */