diff options
Diffstat (limited to 'firmware/drivers/rtc/rtc_s3c2440.c')
-rw-r--r-- | firmware/drivers/rtc/rtc_s3c2440.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/firmware/drivers/rtc/rtc_s3c2440.c b/firmware/drivers/rtc/rtc_s3c2440.c index ae422ffc2d..b1bc622058 100644 --- a/firmware/drivers/rtc/rtc_s3c2440.c +++ b/firmware/drivers/rtc/rtc_s3c2440.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include "rtc.h" | 21 | #include "rtc.h" |
22 | #include "kernel.h" | 22 | #include "kernel.h" |
23 | #include "system.h" | 23 | #include "system.h" |
24 | #include <stdbool.h> | ||
25 | 24 | ||
26 | void rtc_init(void) | 25 | void rtc_init(void) |
27 | { | 26 | { |
@@ -55,7 +54,7 @@ int rtc_write_datetime(unsigned char* buf) | |||
55 | return 1; | 54 | return 1; |
56 | } | 55 | } |
57 | 56 | ||
58 | #ifdef HAVE_RTC_ALARM | 57 | #ifdef HAVE_RTC_ALARM |
59 | /* This alarm code works in that it at least triggers INT_RTC. I am guessing | 58 | /* This alarm code works in that it at least triggers INT_RTC. I am guessing |
60 | * that the OF bootloader for the Gigabeat detects the startup by alarm and shuts down. | 59 | * that the OF bootloader for the Gigabeat detects the startup by alarm and shuts down. |
61 | * This code is available for use once the OF bootloader is no longer required. | 60 | * This code is available for use once the OF bootloader is no longer required. |
@@ -110,13 +109,16 @@ void rtc_get_alarm(int *h, int *m) | |||
110 | */ | 109 | */ |
111 | bool rtc_enable_alarm(bool enable) | 110 | bool rtc_enable_alarm(bool enable) |
112 | { | 111 | { |
113 | /* Note: The interupt for the alarm is normally masked. May want to enable ( INTMSK&=~(1<<30); ) | ||
114 | * it here if an alarm handler is desired (while the unit is not in sleep). | ||
115 | */ | ||
116 | if (enable) | 112 | if (enable) |
113 | { | ||
117 | RTCALM=0x46; | 114 | RTCALM=0x46; |
115 | INTMSK&=~(1<<30); | ||
116 | } | ||
118 | else | 117 | else |
118 | { | ||
119 | RTCALM=0x00; | 119 | RTCALM=0x00; |
120 | INTMSK|=(1<<30); | ||
121 | } | ||
120 | 122 | ||
121 | return false; /* all ok */ | 123 | return false; /* all ok */ |
122 | } | 124 | } |