summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-05-22 00:28:26 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-05-22 00:28:26 +0000
commitba46c88c6f077f7e6e1c266e9742870802037b68 (patch)
tree8a663c4f83c4f11d19360c044a351e8bd7ced252
parent8302c5fe17b0c9e74f1c1d9941c852153516387d (diff)
downloadrockbox-ba46c88c6f077f7e6e1c266e9742870802037b68.tar.gz
rockbox-ba46c88c6f077f7e6e1c266e9742870802037b68.zip
rtc_enable_alarm() needs no return value
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26245 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/rtc/rtc_as3514.c4
-rw-r--r--firmware/drivers/rtc/rtc_ds1339_ds3231.c6
-rw-r--r--firmware/drivers/rtc/rtc_e8564.c6
-rw-r--r--firmware/drivers/rtc/rtc_m41st84w.c6
-rw-r--r--firmware/drivers/rtc/rtc_mc13783.c4
-rw-r--r--firmware/drivers/rtc/rtc_pcf50605.c4
-rw-r--r--firmware/drivers/rtc/rtc_s3c2440.c5
-rw-r--r--firmware/drivers/rtc/rtc_tcc77x.c2
-rw-r--r--firmware/export/rtc.h2
-rw-r--r--uisimulator/common/stubs.c4
10 files changed, 13 insertions, 30 deletions
diff --git a/firmware/drivers/rtc/rtc_as3514.c b/firmware/drivers/rtc/rtc_as3514.c
index fe2921b433..e5db839e77 100644
--- a/firmware/drivers/rtc/rtc_as3514.c
+++ b/firmware/drivers/rtc/rtc_as3514.c
@@ -111,9 +111,9 @@ void rtc_alarm_poweroff(void)
111 while(1); 111 while(1);
112} 112}
113 113
114bool rtc_enable_alarm(bool enable) 114void rtc_enable_alarm(bool enable)
115{ 115{
116 return alarm_enabled = enable; 116 alarm_enabled = enable;
117} 117}
118 118
119bool rtc_check_alarm_started(bool release_alarm) 119bool rtc_check_alarm_started(bool release_alarm)
diff --git a/firmware/drivers/rtc/rtc_ds1339_ds3231.c b/firmware/drivers/rtc/rtc_ds1339_ds3231.c
index 01624e048b..a813e8d999 100644
--- a/firmware/drivers/rtc/rtc_ds1339_ds3231.c
+++ b/firmware/drivers/rtc/rtc_ds1339_ds3231.c
@@ -99,9 +99,7 @@ void rtc_get_alarm(int *h, int *m)
99/* turn alarm on or off by setting the alarm flag enable */ 99/* turn alarm on or off by setting the alarm flag enable */
100/* the alarm is automatically disabled when the RTC gets Vcc power at startup */ 100/* the alarm is automatically disabled when the RTC gets Vcc power at startup */
101/* avoid that an alarm occurs when the device is on because this locks the ON key forever */ 101/* avoid that an alarm occurs when the device is on because this locks the ON key forever */
102/* returns false if alarm was set and alarm flag (output) is off */ 102void rtc_enable_alarm(bool enable)
103/* returns true if alarm flag went on, which would lock the device, so the alarm was disabled again */
104bool rtc_enable_alarm(bool enable)
105{ 103{
106 unsigned char buf[2]; 104 unsigned char buf[2];
107 105
@@ -109,8 +107,6 @@ bool rtc_enable_alarm(bool enable)
109 buf[1] = 0x00; /* reset alarm flags (and OSF for good measure) */ 107 buf[1] = 0x00; /* reset alarm flags (and OSF for good measure) */
110 108
111 sw_i2c_write(RTC_ADDR, 0x0e, buf, 2); 109 sw_i2c_write(RTC_ADDR, 0x0e, buf, 2);
112
113 return false; /* all ok */
114} 110}
115 111
116#endif /* HAVE_RTC_ALARM */ 112#endif /* HAVE_RTC_ALARM */
diff --git a/firmware/drivers/rtc/rtc_e8564.c b/firmware/drivers/rtc/rtc_e8564.c
index 8b9f6bfa42..54e663424b 100644
--- a/firmware/drivers/rtc/rtc_e8564.c
+++ b/firmware/drivers/rtc/rtc_e8564.c
@@ -154,7 +154,7 @@ void rtc_get_alarm(int *h, int *m)
154 *h = BCD2DEC(buf[0] & 0x3f); 154 *h = BCD2DEC(buf[0] & 0x3f);
155} 155}
156 156
157bool rtc_enable_alarm(bool enable) 157void rtc_enable_alarm(bool enable)
158{ 158{
159 unsigned char tmp=0; 159 unsigned char tmp=0;
160 int rv=0; 160 int rv=0;
@@ -172,13 +172,11 @@ bool rtc_enable_alarm(bool enable)
172 /* disable alarm interrupt */ 172 /* disable alarm interrupt */
173 if(rtc_lock_alarm_clear) 173 if(rtc_lock_alarm_clear)
174 /* lock disabling alarm before it was checked whether or not the unit was started by RTC alarm */ 174 /* lock disabling alarm before it was checked whether or not the unit was started by RTC alarm */
175 return false; 175 return;
176 rv = i2c_readbytes(RTC_ADDR, RTC_CTRL2, 1, &tmp); 176 rv = i2c_readbytes(RTC_ADDR, RTC_CTRL2, 1, &tmp);
177 tmp &= ~(RTC_AIE | RTC_AF); 177 tmp &= ~(RTC_AIE | RTC_AF);
178 pp_i2c_send(RTC_ADDR, RTC_CTRL2, tmp); 178 pp_i2c_send(RTC_ADDR, RTC_CTRL2, tmp);
179 } 179 }
180
181 return false;
182} 180}
183 181
184bool rtc_check_alarm_started(bool release_alarm) 182bool rtc_check_alarm_started(bool release_alarm)
diff --git a/firmware/drivers/rtc/rtc_m41st84w.c b/firmware/drivers/rtc/rtc_m41st84w.c
index 5374f66f24..4cfa155bfb 100644
--- a/firmware/drivers/rtc/rtc_m41st84w.c
+++ b/firmware/drivers/rtc/rtc_m41st84w.c
@@ -137,9 +137,7 @@ void rtc_get_alarm(int *h, int *m)
137/* turn alarm on or off by setting the alarm flag enable */ 137/* turn alarm on or off by setting the alarm flag enable */
138/* the alarm is automatically disabled when the RTC gets Vcc power at startup */ 138/* the alarm is automatically disabled when the RTC gets Vcc power at startup */
139/* avoid that an alarm occurs when the device is on because this locks the ON key forever */ 139/* avoid that an alarm occurs when the device is on because this locks the ON key forever */
140/* returns false if alarm was set and alarm flag (output) is off */ 140void rtc_enable_alarm(bool enable)
141/* returns true if alarm flag went on, which would lock the device, so the alarm was disabled again */
142bool rtc_enable_alarm(bool enable)
143{ 141{
144 unsigned char data = rtc_read(0x0a); 142 unsigned char data = rtc_read(0x0a);
145 if (enable) 143 if (enable)
@@ -164,8 +162,6 @@ bool rtc_enable_alarm(bool enable)
164 data |= 0xa0; /* turn bit d7=AFE and d5=ABE on */ 162 data |= 0xa0; /* turn bit d7=AFE and d5=ABE on */
165 rtc_write(0x0a, data); 163 rtc_write(0x0a, data);
166 } 164 }
167
168 return false; /* all ok */
169} 165}
170 166
171#endif /* HAVE_RTC_ALARM */ 167#endif /* HAVE_RTC_ALARM */
diff --git a/firmware/drivers/rtc/rtc_mc13783.c b/firmware/drivers/rtc/rtc_mc13783.c
index 9cef3e904c..d98ae9ba06 100644
--- a/firmware/drivers/rtc/rtc_mc13783.c
+++ b/firmware/drivers/rtc/rtc_mc13783.c
@@ -218,14 +218,12 @@ bool rtc_check_alarm_flag(void)
218 return false; 218 return false;
219} 219}
220 220
221bool rtc_enable_alarm(bool enable) 221void rtc_enable_alarm(bool enable)
222{ 222{
223 if (enable) 223 if (enable)
224 mc13783_clear(MC13783_INTERRUPT_MASK1, MC13783_TODAM); 224 mc13783_clear(MC13783_INTERRUPT_MASK1, MC13783_TODAM);
225 else 225 else
226 mc13783_set(MC13783_INTERRUPT_MASK1, MC13783_TODAM); 226 mc13783_set(MC13783_INTERRUPT_MASK1, MC13783_TODAM);
227
228 return false;
229} 227}
230 228
231bool rtc_check_alarm_started(bool release_alarm) 229bool rtc_check_alarm_started(bool release_alarm)
diff --git a/firmware/drivers/rtc/rtc_pcf50605.c b/firmware/drivers/rtc/rtc_pcf50605.c
index b030fba37a..8c54a590c6 100644
--- a/firmware/drivers/rtc/rtc_pcf50605.c
+++ b/firmware/drivers/rtc/rtc_pcf50605.c
@@ -92,9 +92,8 @@ bool rtc_check_alarm_flag(void)
92 * The Ipod bootloader clears all PCF interrupt registers and always enables 92 * The Ipod bootloader clears all PCF interrupt registers and always enables
93 * the "wake on RTC" bit on OOCC1, so we have to rely on other means to find 93 * the "wake on RTC" bit on OOCC1, so we have to rely on other means to find
94 * out if we just woke from an alarm. 94 * out if we just woke from an alarm.
95 * Return value is always false for us.
96 */ 95 */
97bool rtc_enable_alarm(bool enable) 96void rtc_enable_alarm(bool enable)
98{ 97{
99 if (enable) { 98 if (enable) {
100 /* Tell the PCF to ignore everything but second, minute and hour, so 99 /* Tell the PCF to ignore everything but second, minute and hour, so
@@ -114,7 +113,6 @@ bool rtc_enable_alarm(bool enable)
114 /* Make sure we don't wake on RTC after shutting down */ 113 /* Make sure we don't wake on RTC after shutting down */
115 pcf50605_wakeup_flags &= ~0x10; 114 pcf50605_wakeup_flags &= ~0x10;
116 } 115 }
117 return false;
118} 116}
119 117
120/** 118/**
diff --git a/firmware/drivers/rtc/rtc_s3c2440.c b/firmware/drivers/rtc/rtc_s3c2440.c
index 9b449052a9..52ba75345c 100644
--- a/firmware/drivers/rtc/rtc_s3c2440.c
+++ b/firmware/drivers/rtc/rtc_s3c2440.c
@@ -100,9 +100,8 @@ void rtc_get_alarm(int *h, int *m)
100} 100}
101 101
102/* turn alarm on or off by setting the alarm flag enable 102/* turn alarm on or off by setting the alarm flag enable
103 * returns false if alarm was set and alarm flag (output) is off
104 */ 103 */
105bool rtc_enable_alarm(bool enable) 104vodi rtc_enable_alarm(bool enable)
106{ 105{
107 if (enable) 106 if (enable)
108 { 107 {
@@ -112,7 +111,5 @@ bool rtc_enable_alarm(bool enable)
112 { 111 {
113 RTCALM=0x00; 112 RTCALM=0x00;
114 } 113 }
115
116 return false; /* all ok */
117} 114}
118#endif 115#endif
diff --git a/firmware/drivers/rtc/rtc_tcc77x.c b/firmware/drivers/rtc/rtc_tcc77x.c
index ae1c74f8ae..0ae4059f8a 100644
--- a/firmware/drivers/rtc/rtc_tcc77x.c
+++ b/firmware/drivers/rtc/rtc_tcc77x.c
@@ -48,7 +48,7 @@ bool rtc_check_alarm_flag(void)
48/** 48/**
49 * Enables or disables the alarm. 49 * Enables or disables the alarm.
50 */ 50 */
51bool rtc_enable_alarm(bool enable) 51void rtc_enable_alarm(bool enable)
52{ 52{
53} 53}
54 54
diff --git a/firmware/export/rtc.h b/firmware/export/rtc.h
index 57853f28cc..216de87dea 100644
--- a/firmware/export/rtc.h
+++ b/firmware/export/rtc.h
@@ -51,7 +51,7 @@ int rtc_write(unsigned char address, unsigned char value);
51#ifdef HAVE_RTC_ALARM 51#ifdef HAVE_RTC_ALARM
52void rtc_set_alarm(int h, int m); 52void rtc_set_alarm(int h, int m);
53void rtc_get_alarm(int *h, int *m); 53void rtc_get_alarm(int *h, int *m);
54bool rtc_enable_alarm(bool enable); 54void rtc_enable_alarm(bool enable);
55bool rtc_check_alarm_started(bool release_alarm); 55bool rtc_check_alarm_started(bool release_alarm);
56bool rtc_check_alarm_flag(void); 56bool rtc_check_alarm_flag(void);
57#endif /* HAVE_RTC_ALARM */ 57#endif /* HAVE_RTC_ALARM */
diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c
index 2aa0f12f89..ee0c9f113c 100644
--- a/uisimulator/common/stubs.c
+++ b/uisimulator/common/stubs.c
@@ -169,9 +169,9 @@ void rtc_set_alarm(int h, int m)
169 (void)m; 169 (void)m;
170} 170}
171 171
172bool rtc_enable_alarm(bool enable) 172void rtc_enable_alarm(bool enable)
173{ 173{
174 return enable; 174 (void)enable;
175} 175}
176 176
177extern bool sim_alarm_wakeup; 177extern bool sim_alarm_wakeup;