diff options
Diffstat (limited to 'firmware/drivers/rtc/rtc_pcf50606.c')
-rw-r--r-- | firmware/drivers/rtc/rtc_pcf50606.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/firmware/drivers/rtc/rtc_pcf50606.c b/firmware/drivers/rtc/rtc_pcf50606.c index cb6697207b..2c751e5b01 100644 --- a/firmware/drivers/rtc/rtc_pcf50606.c +++ b/firmware/drivers/rtc/rtc_pcf50606.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "kernel.h" | 24 | #include "kernel.h" |
25 | #include "system.h" | 25 | #include "system.h" |
26 | #include "pcf50606.h" | 26 | #include "pcf50606.h" |
27 | #include "timefuncs.h" | ||
27 | 28 | ||
28 | void rtc_init(void) | 29 | void rtc_init(void) |
29 | { | 30 | { |
@@ -47,9 +48,9 @@ int rtc_read_datetime(struct tm *tm) | |||
47 | tm->tm_sec = buf[0]; | 48 | tm->tm_sec = buf[0]; |
48 | tm->tm_min = buf[1]; | 49 | tm->tm_min = buf[1]; |
49 | tm->tm_hour = buf[2]; | 50 | tm->tm_hour = buf[2]; |
50 | tm->tm_wday = buf[3]; | ||
51 | tm->tm_mday = buf[4]; | 51 | tm->tm_mday = buf[4]; |
52 | tm->tm_mon = buf[5] - 1; | 52 | tm->tm_mon = buf[5] - 1; |
53 | tm->tm_yday = 0; /* Not implemented for now */ | ||
53 | #ifdef IRIVER_H300_SERIES | 54 | #ifdef IRIVER_H300_SERIES |
54 | /* Special kludge to coexist with the iriver firmware. The iriver firmware | 55 | /* Special kludge to coexist with the iriver firmware. The iriver firmware |
55 | stores the date as 1965+nn, and allows a range of 1980..2064. We use | 56 | stores the date as 1965+nn, and allows a range of 1980..2064. We use |
@@ -60,6 +61,8 @@ int rtc_read_datetime(struct tm *tm) | |||
60 | tm->tm_year = buf[6] + 100; | 61 | tm->tm_year = buf[6] + 100; |
61 | #endif /* IRIVER_H300_SERIES */ | 62 | #endif /* IRIVER_H300_SERIES */ |
62 | 63 | ||
64 | set_day_of_week(tm); | ||
65 | |||
63 | return rc; | 66 | return rc; |
64 | } | 67 | } |
65 | 68 | ||