diff options
-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 fd01421644..9ed8540b5d 100644 --- a/firmware/drivers/rtc/rtc_imx233.c +++ b/firmware/drivers/rtc/rtc_imx233.c | |||
@@ -36,15 +36,15 @@ void rtc_init(void) | |||
36 | int rtc_read_datetime(struct tm *tm) | 36 | int rtc_read_datetime(struct tm *tm) |
37 | { | 37 | { |
38 | uint32_t seconds = imx233_rtc_read_seconds(); | 38 | uint32_t seconds = imx233_rtc_read_seconds(); |
39 | #ifdef SANSA_FUZEPLUS | 39 | #if defined(SANSA_FUZEPLUS) || defined(CREATIVE_ZENXFI3) |
40 | /* The OF uses PERSISTENT2 register to keep the adjustment and only changes | 40 | /* The OF uses PERSISTENT2 register to keep the adjustment and only changes |
41 | * SECONDS if necessary. */ | 41 | * SECONDS if necessary. */ |
42 | seconds += imx233_rtc_read_persistent(2); | 42 | seconds += imx233_rtc_read_persistent(2); |
43 | #else | 43 | #else |
44 | /* The Freescale recommended way of keeping time is the number of seconds | 44 | /* The Freescale recommended way of keeping time is the number of seconds |
45 | * since 00:00 1/1/1980 */ | 45 | * since 00:00 1/1/1980 */ |
46 | seconds += YEAR1980; | 46 | seconds += YEAR1980; |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | gmtime_r(&seconds, tm); | 49 | gmtime_r(&seconds, tm); |
50 | 50 | ||
@@ -57,18 +57,18 @@ int rtc_write_datetime(const struct tm *tm) | |||
57 | 57 | ||
58 | seconds = mktime((struct tm *)tm); | 58 | seconds = mktime((struct tm *)tm); |
59 | 59 | ||
60 | #ifdef SANSA_FUZEPLUS | 60 | #if defined(SANSA_FUZEPLUS) || defined(CREATIVE_ZENXFI3) |
61 | /* The OF uses PERSISTENT2 register to keep the adjustment and only changes | 61 | /* The OF uses PERSISTENT2 register to keep the adjustment and only changes |
62 | * SECONDS if necessary. | 62 | * SECONDS if necessary. |
63 | * NOTE: the OF uses this mechanism to prevent roll back in time. Although | 63 | * NOTE: the OF uses this mechanism to prevent roll back in time. Although |
64 | * Rockbox will handle a negative PERSISTENT2 value, the OF will detect | 64 | * Rockbox will handle a negative PERSISTENT2 value, the OF will detect |
65 | * it and won't return in time before SECONDS */ | 65 | * it and won't return in time before SECONDS */ |
66 | imx233_rtc_write_persistent(2, seconds - imx233_rtc_read_seconds()); | 66 | imx233_rtc_write_persistent(2, seconds - imx233_rtc_read_seconds()); |
67 | #else | 67 | #else |
68 | /* The Freescale recommended way of keeping time is the number of seconds | 68 | /* The Freescale recommended way of keeping time is the number of seconds |
69 | * since 00:00 1/1/1980 */ | 69 | * since 00:00 1/1/1980 */ |
70 | imx233_rtc_write_seconds(seconds - YEAR1980); | 70 | imx233_rtc_write_seconds(seconds - YEAR1980); |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | return 0; | 73 | return 0; |
74 | } | 74 | } |