diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2017-01-26 21:08:55 -0500 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2017-11-21 07:52:02 -0500 |
commit | f4c42213062170ddfcc706b3c5ed19f47517c253 (patch) | |
tree | 65f8058970e97d939660cf1e39f844a06df66f84 /firmware/target/arm/imx31 | |
parent | 12bc24adbf919dc945928b2dcda74d51d33708f7 (diff) | |
download | rockbox-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.h | 4 | ||||
-rw-r--r-- | firmware/target/arm/imx31/rtc-target.h | 27 |
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 = | |||
46 | MC13783_EVENT_VECTOR_TBL_START() | 46 | MC13783_EVENT_VECTOR_TBL_START() |
47 | /* ADC conversion complete */ | 47 | /* ADC conversion complete */ |
48 | MC13783_EVENT_VECTOR(ADCDONE, 0) | 48 | MC13783_EVENT_VECTOR(ADCDONE, 0) |
49 | #if CONFIG_RTC | ||
50 | /* RTC tick */ | ||
51 | MC13783_EVENT_VECTOR(1HZ, 0) | ||
52 | #endif /* CONFIG_RTC */ | ||
49 | /* Power button */ | 53 | /* Power button */ |
50 | MC13783_EVENT_VECTOR(ONOFD1, MC13783_ONOFD1S) | 54 | MC13783_EVENT_VECTOR(ONOFD1, MC13783_ONOFD1S) |
51 | /* Main charger detection */ | 55 | /* 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 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2017 by Michael Sevakis | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #ifndef RTC_TARGET_H | ||
22 | #define RTC_TARGET_H | ||
23 | |||
24 | bool rtc_mc13783_dirty(void); | ||
25 | #define rtc_dirty rtc_mc13783_dirty | ||
26 | |||
27 | #endif /* RTC_TARGET_H */ | ||