summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/s5l8700/ipodnano2g/rtc-nano2g.c5
-rw-r--r--firmware/target/arm/s5l8702/ipod6g/rtc-ipod6g.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/rtc-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/rtc-nano2g.c
index 39cecc5291..6f6b58ca35 100644
--- a/firmware/target/arm/s5l8700/ipodnano2g/rtc-nano2g.c
+++ b/firmware/target/arm/s5l8700/ipodnano2g/rtc-nano2g.c
@@ -23,6 +23,7 @@
23#include "kernel.h" 23#include "kernel.h"
24#include "system.h" 24#include "system.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{
@@ -41,10 +42,12 @@ int rtc_read_datetime(struct tm *tm)
41 tm->tm_sec = buf[0]; 42 tm->tm_sec = buf[0];
42 tm->tm_min = buf[1]; 43 tm->tm_min = buf[1];
43 tm->tm_hour = buf[2]; 44 tm->tm_hour = buf[2];
44 tm->tm_wday = buf[3];
45 tm->tm_mday = buf[4]; 45 tm->tm_mday = buf[4];
46 tm->tm_mon = buf[5] - 1; 46 tm->tm_mon = buf[5] - 1;
47 tm->tm_year = buf[6] + 100; 47 tm->tm_year = buf[6] + 100;
48 tm->tm_yday = 0; /* Not implemented for now */
49
50 set_day_of_week(tm);
48 51
49 return 0; 52 return 0;
50} 53}
diff --git a/firmware/target/arm/s5l8702/ipod6g/rtc-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/rtc-ipod6g.c
index 76ef8ecb00..384cded758 100644
--- a/firmware/target/arm/s5l8702/ipod6g/rtc-ipod6g.c
+++ b/firmware/target/arm/s5l8702/ipod6g/rtc-ipod6g.c
@@ -23,6 +23,7 @@
23#include "kernel.h" 23#include "kernel.h"
24#include "system.h" 24#include "system.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{
@@ -41,10 +42,12 @@ int rtc_read_datetime(struct tm *tm)
41 tm->tm_sec = buf[0]; 42 tm->tm_sec = buf[0];
42 tm->tm_min = buf[1]; 43 tm->tm_min = buf[1];
43 tm->tm_hour = buf[2]; 44 tm->tm_hour = buf[2];
44 tm->tm_wday = buf[3];
45 tm->tm_mday = buf[4]; 45 tm->tm_mday = buf[4];
46 tm->tm_mon = buf[5] - 1; 46 tm->tm_mon = buf[5] - 1;
47 tm->tm_year = buf[6] + 100; 47 tm->tm_year = buf[6] + 100;
48 tm->tm_yday = 0; /* Not implemented for now */
49
50 set_day_of_week(tm);
48 51
49 return 0; 52 return 0;
50} 53}