summaryrefslogtreecommitdiff
path: root/firmware/drivers/rtc/rtc_d2.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/rtc/rtc_d2.c')
-rw-r--r--firmware/drivers/rtc/rtc_d2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/firmware/drivers/rtc/rtc_d2.c b/firmware/drivers/rtc/rtc_d2.c
index a2a40fe7ac..1d202410e2 100644
--- a/firmware/drivers/rtc/rtc_d2.c
+++ b/firmware/drivers/rtc/rtc_d2.c
@@ -23,6 +23,7 @@
23#include "pcf50606.h" 23#include "pcf50606.h"
24#include "pcf50635.h" 24#include "pcf50635.h"
25#include "pmu-target.h" 25#include "pmu-target.h"
26#include "timefuncs.h"
26 27
27void rtc_init(void) 28void rtc_init(void)
28{ 29{
@@ -49,10 +50,12 @@ int rtc_read_datetime(struct tm *tm)
49 tm->tm_sec = buf[0]; 50 tm->tm_sec = buf[0];
50 tm->tm_min = buf[1]; 51 tm->tm_min = buf[1];
51 tm->tm_hour = buf[2]; 52 tm->tm_hour = buf[2];
52 tm->tm_wday = buf[3];
53 tm->tm_mday = buf[4]; 53 tm->tm_mday = buf[4];
54 tm->tm_mon = buf[5] - 1; 54 tm->tm_mon = buf[5] - 1;
55 tm->tm_year = buf[6] + 100; 55 tm->tm_year = buf[6] + 100;
56 tm->tm_yday = 0; /* Not implemented for now */
57
58 set_day_of_week(tm);
56 59
57 return rc; 60 return rc;
58} 61}