summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx31
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2017-01-26 21:08:55 -0500
committerMichael Sevakis <jethead71@rockbox.org>2017-11-21 07:52:02 -0500
commitf4c42213062170ddfcc706b3c5ed19f47517c253 (patch)
tree65f8058970e97d939660cf1e39f844a06df66f84 /firmware/target/arm/imx31
parent12bc24adbf919dc945928b2dcda74d51d33708f7 (diff)
downloadrockbox-f4c42213062170ddfcc706b3c5ed19f47517c253.tar.gz
rockbox-f4c42213062170ddfcc706b3c5ed19f47517c253.zip
Convert i.MX31 and AMS target to use RTC interrupt
Instead of checking ticks, set a sticky dirty flag that indicates that the RTC needs to be read. This gives a timely update and more accurate readout without actually reading the RTC until it changes. The implementation should atomically read the flag and clear it. Setting the flag would typically happen in an RTC tick ISR. Change-Id: I6fd325f22845029a485c502c884812d3676026ea
Diffstat (limited to 'firmware/target/arm/imx31')
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/mc13783-target.h4
-rw-r--r--firmware/target/arm/imx31/rtc-target.h27
2 files changed, 31 insertions, 0 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/mc13783-target.h b/firmware/target/arm/imx31/gigabeat-s/mc13783-target.h
index 179c65cad6..4bb148e36c 100644
--- a/firmware/target/arm/imx31/gigabeat-s/mc13783-target.h
+++ b/firmware/target/arm/imx31/gigabeat-s/mc13783-target.h
@@ -46,6 +46,10 @@ static struct spi_node mc13783_spi =
MC13783_EVENT_VECTOR_TBL_START()
/* ADC conversion complete */
MC13783_EVENT_VECTOR(ADCDONE, 0)
+#if CONFIG_RTC
+ /* RTC tick */
+ MC13783_EVENT_VECTOR(1HZ, 0)
+#endif /* CONFIG_RTC */
/* Power button */
MC13783_EVENT_VECTOR(ONOFD1, MC13783_ONOFD1S)
/* Main charger detection */
diff --git a/firmware/target/arm/imx31/rtc-target.h b/firmware/target/arm/imx31/rtc-target.h
new file mode 100644
index 0000000000..b6dc46204d
--- /dev/null
+++ b/firmware/target/arm/imx31/rtc-target.h
@@ -0,0 +1,27 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2017 by Michael Sevakis
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+#ifndef RTC_TARGET_H
+#define RTC_TARGET_H
+
+bool rtc_mc13783_dirty(void);
+#define rtc_dirty rtc_mc13783_dirty
+
+#endif /* RTC_TARGET_H */