diff options
Diffstat (limited to 'firmware/drivers/rtc/rtc_mr100.c')
-rw-r--r-- | firmware/drivers/rtc/rtc_mr100.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/firmware/drivers/rtc/rtc_mr100.c b/firmware/drivers/rtc/rtc_mr100.c index 209845cea8..6e1b0b5f40 100644 --- a/firmware/drivers/rtc/rtc_mr100.c +++ b/firmware/drivers/rtc/rtc_mr100.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "logf.h" | 22 | #include "logf.h" |
23 | #include "sw_i2c.h" | 23 | #include "sw_i2c.h" |
24 | #include "i2c-pp.h" | 24 | #include "i2c-pp.h" |
25 | #include "timefuncs.h" | ||
25 | 26 | ||
26 | /* The RTC chip is unknown, the information about it was gathered by | 27 | /* The RTC chip is unknown, the information about it was gathered by |
27 | * reverse engineering the bootloader. | 28 | * reverse engineering the bootloader. |
@@ -140,10 +141,12 @@ int rtc_read_datetime(struct tm *tm) | |||
140 | tm->tm_sec = buf[6]; | 141 | tm->tm_sec = buf[6]; |
141 | tm->tm_min = buf[5]; | 142 | tm->tm_min = buf[5]; |
142 | tm->tm_hour = buf[4]; | 143 | tm->tm_hour = buf[4]; |
143 | tm->tm_wday = buf[3]; | ||
144 | tm->tm_mday = buf[2]; | 144 | tm->tm_mday = buf[2]; |
145 | tm->tm_mon = buf[1] - 1; | 145 | tm->tm_mon = buf[1] - 1; |
146 | tm->tm_year = buf[0] + 100; | 146 | tm->tm_year = buf[0] + 100; |
147 | tm->tm_yday = 0; /* Not implemented for now */ | ||
148 | |||
149 | set_day_of_week(tm); | ||
147 | 150 | ||
148 | return rc; | 151 | return rc; |
149 | } | 152 | } |