git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: restructure the user space stuff.
[lunaix-os.git]
/
lunaix-os
/
hal
/
rtc.c
diff --git
a/lunaix-os/hal/rtc.c
b/lunaix-os/hal/rtc.c
index 2ffe76b14e2b4bf6c41e4bdc63072b417feca3bc..bc2c2ef497ab2e7e33a01a179c3b427a7ef08515 100644
(file)
--- a/
lunaix-os/hal/rtc.c
+++ b/
lunaix-os/hal/rtc.c
@@
-13,7
+13,7
@@
void
rtc_init() {
void
rtc_init() {
- u
int
8_t regA = rtc_read_reg(RTC_REG_A | WITH_NMI_DISABLED);
+ u8_t regA = rtc_read_reg(RTC_REG_A | WITH_NMI_DISABLED);
regA = (regA & ~0x7f) | RTC_FREQUENCY_1024HZ | RTC_DIVIDER_33KHZ;
rtc_write_reg(RTC_REG_A | WITH_NMI_DISABLED, regA);
regA = (regA & ~0x7f) | RTC_FREQUENCY_1024HZ | RTC_DIVIDER_33KHZ;
rtc_write_reg(RTC_REG_A | WITH_NMI_DISABLED, regA);
@@
-21,22
+21,22
@@
rtc_init() {
rtc_disable_timer();
}
rtc_disable_timer();
}
-u
int
8_t
-rtc_read_reg(u
int
8_t reg_selector)
+u8_t
+rtc_read_reg(u8_t reg_selector)
{
io_outb(RTC_INDEX_PORT, reg_selector);
return io_inb(RTC_TARGET_PORT);
}
void
{
io_outb(RTC_INDEX_PORT, reg_selector);
return io_inb(RTC_TARGET_PORT);
}
void
-rtc_write_reg(u
int8_t reg_selector, uint
8_t val)
+rtc_write_reg(u
8_t reg_selector, u
8_t val)
{
io_outb(RTC_INDEX_PORT, reg_selector);
io_outb(RTC_TARGET_PORT, val);
}
{
io_outb(RTC_INDEX_PORT, reg_selector);
io_outb(RTC_TARGET_PORT, val);
}
-u
int
8_t
-bcd2dec(u
int
8_t bcd)
+u8_t
+bcd2dec(u8_t bcd)
{
return ((bcd & 0xF0) >> 1) + ((bcd & 0xF0) >> 3) + (bcd & 0xf);
}
{
return ((bcd & 0xF0) >> 1) + ((bcd & 0xF0) >> 3) + (bcd & 0xf);
}
@@
-44,12
+44,12
@@
bcd2dec(uint8_t bcd)
void
rtc_enable_timer() {
void
rtc_enable_timer() {
- u
int
8_t regB = rtc_read_reg(RTC_REG_B | WITH_NMI_DISABLED);
+ u8_t regB = rtc_read_reg(RTC_REG_B | WITH_NMI_DISABLED);
rtc_write_reg(RTC_REG_B | WITH_NMI_DISABLED, regB | RTC_TIMER_ON);
}
void
rtc_disable_timer() {
rtc_write_reg(RTC_REG_B | WITH_NMI_DISABLED, regB | RTC_TIMER_ON);
}
void
rtc_disable_timer() {
- u
int
8_t regB = rtc_read_reg(RTC_REG_B | WITH_NMI_DISABLED);
+ u8_t regB = rtc_read_reg(RTC_REG_B | WITH_NMI_DISABLED);
rtc_write_reg(RTC_REG_B | WITH_NMI_DISABLED, regB & ~RTC_TIMER_ON);
}
\ No newline at end of file
rtc_write_reg(RTC_REG_B | WITH_NMI_DISABLED, regB & ~RTC_TIMER_ON);
}
\ No newline at end of file