summaryrefslogtreecommitdiff
path: root/uisimulator/common/stubs.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/common/stubs.c')
-rw-r--r--uisimulator/common/stubs.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c
index cb208bfeab..2218c497f8 100644
--- a/uisimulator/common/stubs.c
+++ b/uisimulator/common/stubs.c
@@ -142,25 +142,17 @@ int rtc_write(int address, int value)
142 return 0; 142 return 0;
143} 143}
144 144
145int rtc_read_datetime(unsigned char* buf) 145int rtc_read_datetime(struct tm *tm)
146{ 146{
147 time_t now = time(NULL); 147 time_t now = time(NULL);
148 struct tm *teem = localtime(&now); 148 *tm = *localtime(&now);
149
150 buf[0] = (teem->tm_sec%10) | ((teem->tm_sec/10) << 4);
151 buf[1] = (teem->tm_min%10) | ((teem->tm_min/10) << 4);
152 buf[2] = (teem->tm_hour%10) | ((teem->tm_hour/10) << 4);
153 buf[3] = (teem->tm_wday);
154 buf[4] = (teem->tm_mday%10) | ((teem->tm_mday/10) << 4);
155 buf[5] = ((teem->tm_year-100)%10) | (((teem->tm_year-100)/10) << 4);
156 buf[6] = ((teem->tm_mon+1)%10) | (((teem->tm_mon+1)/10) << 4);
157 149
158 return 0; 150 return 0;
159} 151}
160 152
161int rtc_write_datetime(unsigned char* buf) 153int rtc_write_datetime(const struct tm *tm)
162{ 154{
163 (void)buf; 155 (void)tm;
164 return 0; 156 return 0;
165} 157}
166 158