From 50b5ee4781a44234b4ea5dccf3be6ae5ec9fd324 Mon Sep 17 00:00:00 2001 From: Robert Kukla Date: Wed, 28 Feb 2007 13:20:36 +0000 Subject: FS#6419 - driver for H1x0 series RTC Mod with runtime detection git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12520 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/timefuncs.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'firmware/common') diff --git a/firmware/common/timefuncs.c b/firmware/common/timefuncs.c index e48aadd..881bc23 100644 --- a/firmware/common/timefuncs.c +++ b/firmware/common/timefuncs.c @@ -49,6 +49,19 @@ struct tm *get_time(void) #ifdef CONFIG_RTC static long timeout = 0; +#if CONFIG_RTC == RTC_DS1339_DS3231 + if(!rtc_detected) { + tm.tm_sec = 0; + tm.tm_min = 0; + tm.tm_hour = 0; + tm.tm_mday = 1; + tm.tm_mon = 0; + tm.tm_year = 70; + tm.tm_wday = 1; + tm.tm_yday = 0; /* Not implemented for now */ + tm.tm_isdst = -1; /* Not implemented for now */ + } else +#endif /* Don't read the RTC more than once per second */ if (current_tick > timeout) { char rtcbuf[7]; -- cgit v1.1