diff options
Diffstat (limited to 'firmware/drivers/rtc/rtc_s35390a.c')
-rw-r--r-- | firmware/drivers/rtc/rtc_s35390a.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/firmware/drivers/rtc/rtc_s35390a.c b/firmware/drivers/rtc/rtc_s35390a.c index 13027d31a2..b82029a114 100644 --- a/firmware/drivers/rtc/rtc_s35390a.c +++ b/firmware/drivers/rtc/rtc_s35390a.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "config.h" | 22 | #include "config.h" |
23 | #include "rtc.h" | 23 | #include "rtc.h" |
24 | #include "i2c-s5l8700.h" | 24 | #include "i2c-s5l8700.h" |
25 | #include "timefuncs.h" | ||
25 | 26 | ||
26 | /* Driver for the Seiko S35390A real-time clock chip with i2c interface | 27 | /* Driver for the Seiko S35390A real-time clock chip with i2c interface |
27 | 28 | ||
@@ -75,10 +76,12 @@ int rtc_read_datetime(struct tm *tm) | |||
75 | tm->tm_sec = buf[6]; | 76 | tm->tm_sec = buf[6]; |
76 | tm->tm_min = buf[5]; | 77 | tm->tm_min = buf[5]; |
77 | tm->tm_hour = buf[4]; | 78 | tm->tm_hour = buf[4]; |
78 | tm->tm_wday = buf[3]; | ||
79 | tm->tm_mday = buf[2]; | 79 | tm->tm_mday = buf[2]; |
80 | tm->tm_mon = buf[1] - 1; | 80 | tm->tm_mon = buf[1] - 1; |
81 | tm->tm_year = buf[0] + 100; | 81 | tm->tm_year = buf[0] + 100; |
82 | tm->tm_yday = 0; /* Not implemented for now */ | ||
83 | |||
84 | set_day_of_week(tm); | ||
82 | 85 | ||
83 | return ret; | 86 | return ret; |
84 | } | 87 | } |