diff options
Diffstat (limited to 'firmware/drivers/rtc/rtc_s35380a.c')
-rw-r--r-- | firmware/drivers/rtc/rtc_s35380a.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/firmware/drivers/rtc/rtc_s35380a.c b/firmware/drivers/rtc/rtc_s35380a.c index a45924d725..f32c431990 100644 --- a/firmware/drivers/rtc/rtc_s35380a.c +++ b/firmware/drivers/rtc/rtc_s35380a.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "config.h" | 23 | #include "config.h" |
24 | #include "rtc.h" | 24 | #include "rtc.h" |
25 | #include "i2c-coldfire.h" | 25 | #include "i2c-coldfire.h" |
26 | #include "timefuncs.h" | ||
26 | 27 | ||
27 | /* Driver for the Seiko S35380A real-time clock chip with i2c interface | 28 | /* Driver for the Seiko S35380A real-time clock chip with i2c interface |
28 | 29 | ||
@@ -188,10 +189,12 @@ int rtc_read_datetime(struct tm *tm) | |||
188 | tm->tm_sec = buf[TIME_SECOND]; | 189 | tm->tm_sec = buf[TIME_SECOND]; |
189 | tm->tm_min = buf[TIME_MINUTE]; | 190 | tm->tm_min = buf[TIME_MINUTE]; |
190 | tm->tm_hour = buf[TIME_HOUR]; | 191 | tm->tm_hour = buf[TIME_HOUR]; |
191 | tm->tm_wday = buf[TIME_WEEKDAY]; | ||
192 | tm->tm_mday = buf[TIME_DAY]; | 192 | tm->tm_mday = buf[TIME_DAY]; |
193 | tm->tm_mon = buf[TIME_MONTH] - 1; | 193 | tm->tm_mon = buf[TIME_MONTH] - 1; |
194 | tm->tm_year = buf[TIME_YEAR] + 100; | 194 | tm->tm_year = buf[TIME_YEAR] + 100; |
195 | tm->tm_yday = 0; /* Not implemented for now */ | ||
196 | |||
197 | set_day_of_week(tm); | ||
195 | 198 | ||
196 | return ret; | 199 | return ret; |
197 | } | 200 | } |