summaryrefslogtreecommitdiff
path: root/firmware/common/timefuncs.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/timefuncs.c')
-rw-r--r--firmware/common/timefuncs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/firmware/common/timefuncs.c b/firmware/common/timefuncs.c
index af4b596dd0..cffdb3951a 100644
--- a/firmware/common/timefuncs.c
+++ b/firmware/common/timefuncs.c
@@ -105,6 +105,7 @@ int set_time(const struct tm *tm)
105#endif /* RTC */ 105#endif /* RTC */
106} 106}
107 107
108#if CONFIG_RTC
108void set_day_of_week(struct tm *tm) 109void set_day_of_week(struct tm *tm)
109{ 110{
110 int y=tm->tm_year+1900; 111 int y=tm->tm_year+1900;
@@ -115,4 +116,5 @@ void set_day_of_week(struct tm *tm)
115 if(m == 0 || m == 1) y--; 116 if(m == 0 || m == 1) y--;
116 tm->tm_wday = (d + mo[m] + y + y/4 - y/100 + y/400) % 7; 117 tm->tm_wday = (d + mo[m] + y + y/4 - y/100 + y/400) % 7;
117} 118}
119#endif /* CONFIG_RTC */
118 120