diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-05-21 08:42:11 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-05-21 08:42:11 +0000 |
commit | a9c20f5789c13b486d217024a020f9d6163e2d51 (patch) | |
tree | 5da52ca9cc7a28ba21ced042cb739e6160d5f87b /firmware/drivers/rtc/rtc_mc13783.c | |
parent | 5f796087b009fee1ae60904b0355cc7febe3330f (diff) | |
download | rockbox-a9c20f5789c13b486d217024a020f9d6163e2d51.tar.gz rockbox-a9c20f5789c13b486d217024a020f9d6163e2d51.zip |
Gigabeat S:
1) Rework event handling and static registration mechanism. No target-
specific code in mc13783 driver. GPIO event driver interfaces more
cleanly.
2) Somewhat related - enable thread priority for bootloader which is
desireable here (ffs is used for GPIO event enabling anyway and that
goes along with priority).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17593 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/rtc/rtc_mc13783.c')
-rw-r--r-- | firmware/drivers/rtc/rtc_mc13783.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/firmware/drivers/rtc/rtc_mc13783.c b/firmware/drivers/rtc/rtc_mc13783.c index 9d2c50cf11..325a496646 100644 --- a/firmware/drivers/rtc/rtc_mc13783.c +++ b/firmware/drivers/rtc/rtc_mc13783.c | |||
@@ -67,11 +67,6 @@ enum rtc_registers_indexes | |||
67 | /* was it an alarm that triggered power on ? */ | 67 | /* was it an alarm that triggered power on ? */ |
68 | static bool alarm_start = false; | 68 | static bool alarm_start = false; |
69 | 69 | ||
70 | void mc13783_alarm_start(void) | ||
71 | { | ||
72 | alarm_start = true; | ||
73 | } | ||
74 | |||
75 | static const unsigned char rtc_registers[RTC_NUM_REGS] = | 70 | static const unsigned char rtc_registers[RTC_NUM_REGS] = |
76 | { | 71 | { |
77 | [RTC_REG_TIME] = MC13783_RTC_TIME, | 72 | [RTC_REG_TIME] = MC13783_RTC_TIME, |
@@ -122,7 +117,12 @@ static int is_leap_year(int y) | |||
122 | /** Public APIs **/ | 117 | /** Public APIs **/ |
123 | void rtc_init(void) | 118 | void rtc_init(void) |
124 | { | 119 | { |
125 | /* Nothing to do */ | 120 | /* only needs to be polled on startup */ |
121 | if (mc13783_read(MC13783_INTERRUPT_STATUS1) & MC13783_TODAI) | ||
122 | { | ||
123 | alarm_start = true; | ||
124 | mc13783_write(MC13783_INTERRUPT_STATUS1, MC13783_TODAI); | ||
125 | } | ||
126 | } | 126 | } |
127 | 127 | ||
128 | int rtc_read_datetime(unsigned char* buf) | 128 | int rtc_read_datetime(unsigned char* buf) |
@@ -264,7 +264,9 @@ bool rtc_enable_alarm(bool enable) | |||
264 | bool rtc_check_alarm_started(bool release_alarm) | 264 | bool rtc_check_alarm_started(bool release_alarm) |
265 | { | 265 | { |
266 | bool rc = alarm_start; | 266 | bool rc = alarm_start; |
267 | alarm_start &= ~release_alarm; | 267 | |
268 | if (release_alarm) | ||
269 | alarm_start = false; | ||
268 | 270 | ||
269 | return rc; | 271 | return rc; |
270 | } | 272 | } |