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
Timer re-worked!
[lunaix-os.git]
/
lunaix-os
/
hal
/
rtc.c
diff --git
a/lunaix-os/hal/rtc.c
b/lunaix-os/hal/rtc.c
index 60a1aed86654652bb225e655fdd46669aa439719..0e3673c2184800e39866bf335aaf674c2c8adcc8 100644
(file)
--- a/
lunaix-os/hal/rtc.c
+++ b/
lunaix-os/hal/rtc.c
@@
-9,6
+9,7
@@
*
*/
#include <hal/rtc.h>
*
*/
#include <hal/rtc.h>
+#include <lunaix/time.h>
#include <klibc/string.h>
void
#include <klibc/string.h>
void
@@
-42,7
+43,7
@@
bcd2dec(uint8_t bcd)
}
int
}
int
-rtc_date_same(
rtc_datetime* a, rtc_datetime
* b) {
+rtc_date_same(
datetime_t* a, datetime_t
* b) {
return a->year == b->year &&
a->month == b->month &&
a->day == b->day &&
return a->year == b->year &&
a->month == b->month &&
a->day == b->day &&
@@
-52,14
+53,14
@@
rtc_date_same(rtc_datetime* a, rtc_datetime* b) {
}
void
}
void
-
rtc_get_datetime(rtc_datetime
* datetime)
+
time_getdatetime(datetime_t
* datetime)
{
{
-
rtc_datetime
current;
+
datetime_t
current;
do
{
while (rtc_read_reg(RTC_REG_A) & 0x80);
do
{
while (rtc_read_reg(RTC_REG_A) & 0x80);
- memcpy(¤t, datetime, sizeof(
rtc_datetime
));
+ memcpy(¤t, datetime, sizeof(
datetime_t
));
datetime->year = rtc_read_reg(RTC_REG_YRS);
datetime->month = rtc_read_reg(RTC_REG_MTH);
datetime->year = rtc_read_reg(RTC_REG_YRS);
datetime->month = rtc_read_reg(RTC_REG_MTH);