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
chore: fix almost *ALL* warnings.
[lunaix-os.git]
/
lunaix-os
/
kernel
/
time
/
clock.c
diff --git
a/lunaix-os/kernel/time/clock.c
b/lunaix-os/kernel/time/clock.c
index 0f0457530df0f70240de7a6dae5caa8adec0ec5d..e91be19ef18fd61ba2538079e1376247b2f1a397 100644
(file)
--- a/
lunaix-os/kernel/time/clock.c
+++ b/
lunaix-os/kernel/time/clock.c
@@
-4,6
+4,8
@@
#include <lunaix/spike.h>
#include <lunaix/timer.h>
#include <lunaix/spike.h>
#include <lunaix/timer.h>
+#include <klibc/string.h>
+
static volatile time_t sys_time;
void
static volatile time_t sys_time;
void
@@
-101,7
+103,7
@@
clock_walltime(datetime_t* datetime)
datetime->second = rtc_read_reg(RTC_REG_SEC);
} while (!clock_datatime_eq(datetime, ¤t));
datetime->second = rtc_read_reg(RTC_REG_SEC);
} while (!clock_datatime_eq(datetime, ¤t));
- u
int
8_t regbv = rtc_read_reg(RTC_REG_B);
+ u8_t regbv = rtc_read_reg(RTC_REG_B);
// Convert from bcd to binary when needed
if (!RTC_BIN_ENCODED(regbv)) {
// Convert from bcd to binary when needed
if (!RTC_BIN_ENCODED(regbv)) {
@@
-115,7
+117,7
@@
clock_walltime(datetime_t* datetime)
// To 24 hour format
if (!RTC_24HRS_ENCODED(regbv) && (datetime->hour >> 7)) {
// To 24 hour format
if (!RTC_24HRS_ENCODED(regbv) && (datetime->hour >> 7)) {
- datetime->hour =
(12 +
datetime->hour & 0x80);
+ datetime->hour =
12 + (
datetime->hour & 0x80);
}
datetime->year += RTC_CURRENT_CENTRY * 100;
}
datetime->year += RTC_CURRENT_CENTRY * 100;