From f4c42213062170ddfcc706b3c5ed19f47517c253 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Thu, 26 Jan 2017 21:08:55 -0500 Subject: 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 --- firmware/target/arm/imx31/rtc-target.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 firmware/target/arm/imx31/rtc-target.h (limited to 'firmware/target/arm/imx31/rtc-target.h') 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 */ -- cgit v1.2.3