X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/05b7549a0f980efa33265a091a5174a78851ce05..fef29e9e993e62f025d8cbfeb6b8d51588083b7e:/lunaix-os/hal/rtc.c diff --git a/lunaix-os/hal/rtc.c b/lunaix-os/hal/rtc.c index 60a1aed..0e3673c 100644 --- a/lunaix-os/hal/rtc.c +++ b/lunaix-os/hal/rtc.c @@ -9,6 +9,7 @@ * */ #include +#include #include void @@ -42,7 +43,7 @@ bcd2dec(uint8_t bcd) } 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 && @@ -52,14 +53,14 @@ rtc_date_same(rtc_datetime* a, rtc_datetime* b) { } 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); - 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);