diff options
| author | Bertrik Sikken <bertrik@sikken.nl> | 2012-05-27 00:14:42 +0200 |
|---|---|---|
| committer | Bertrik Sikken <bertrik@sikken.nl> | 2012-05-27 00:16:40 +0200 |
| commit | fca9e7bf8d48f2fcc4c8b21cc29aabf2ce053900 (patch) | |
| tree | 528a508f52e45d4e4eab67ecced9b912b122ae84 /firmware | |
| parent | d523fd6e6407137ce12395a49223ba41009357ba (diff) | |
| download | rockbox-fca9e7bf8d48f2fcc4c8b21cc29aabf2ce053900.zip rockbox-fca9e7bf8d48f2fcc4c8b21cc29aabf2ce053900.tar.gz rockbox-fca9e7bf8d48f2fcc4c8b21cc29aabf2ce053900.tar.bz2 rockbox-fca9e7bf8d48f2fcc4c8b21cc29aabf2ce053900.tar.xz | |
zenxfi3: RTC is used in same was as in fuze+, using seconds-since-1970 plus an offset
Change-Id: Iab2e6e15c790c26d3bf2679e9f965a409d162783
Diffstat (limited to 'firmware')
| -rw-r--r-- | firmware/drivers/rtc/rtc_imx233.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware/drivers/rtc/rtc_imx233.c b/firmware/drivers/rtc/rtc_imx233.c index fd01421..9ed8540 100644 --- a/firmware/drivers/rtc/rtc_imx233.c +++ b/firmware/drivers/rtc/rtc_imx233.c @@ -36,15 +36,15 @@ void rtc_init(void) int rtc_read_datetime(struct tm *tm) { uint32_t seconds = imx233_rtc_read_seconds(); - #ifdef SANSA_FUZEPLUS +#if defined(SANSA_FUZEPLUS) || defined(CREATIVE_ZENXFI3) /* The OF uses PERSISTENT2 register to keep the adjustment and only changes * SECONDS if necessary. */ seconds += imx233_rtc_read_persistent(2); - #else +#else /* The Freescale recommended way of keeping time is the number of seconds * since 00:00 1/1/1980 */ seconds += YEAR1980; - #endif +#endif gmtime_r(&seconds, tm); @@ -57,18 +57,18 @@ int rtc_write_datetime(const struct tm *tm) seconds = mktime((struct tm *)tm); - #ifdef SANSA_FUZEPLUS +#if defined(SANSA_FUZEPLUS) || defined(CREATIVE_ZENXFI3) /* The OF uses PERSISTENT2 register to keep the adjustment and only changes * SECONDS if necessary. * NOTE: the OF uses this mechanism to prevent roll back in time. Although * Rockbox will handle a negative PERSISTENT2 value, the OF will detect * it and won't return in time before SECONDS */ imx233_rtc_write_persistent(2, seconds - imx233_rtc_read_seconds()); - #else +#else /* The Freescale recommended way of keeping time is the number of seconds * since 00:00 1/1/1980 */ imx233_rtc_write_seconds(seconds - YEAR1980); - #endif +#endif return 0; } |