summaryrefslogtreecommitdiffstats
path: root/firmware/common
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common')
-rw-r--r--firmware/common/timefuncs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/common/timefuncs.c b/firmware/common/timefuncs.c
index d46b961a8c..53ca5f3c16 100644
--- a/firmware/common/timefuncs.c
+++ b/firmware/common/timefuncs.c
@@ -104,10 +104,13 @@ int set_time(const struct tm *tm)
{
#if CONFIG_RTC
int rc;
+#if CONFIG_RTC != RTC_JZ47XX
char rtcbuf[7];
+#endif
if (valid_time(tm))
{
+#if CONFIG_RTC != RTC_JZ47XX
rtcbuf[0]=((tm->tm_sec/10) << 4) | (tm->tm_sec%10);
rtcbuf[1]=((tm->tm_min/10) << 4) | (tm->tm_min%10);
rtcbuf[2]=((tm->tm_hour/10) << 4) | (tm->tm_hour%10);
@@ -122,6 +125,9 @@ int set_time(const struct tm *tm)
#endif
rc = rtc_write_datetime(rtcbuf);
+#else
+ rc = rtc_write_datetime((unsigned char*)tm);
+#endif
if (rc < 0)
return -1;