summaryrefslogtreecommitdiffstats
path: root/apps/alarm_menu.c
diff options
context:
space:
mode:
authorChristi Scarborough <christi@coraline.org>2005-02-06 17:21:42 +0000
committerChristi Scarborough <christi@coraline.org>2005-02-06 17:21:42 +0000
commita83ffb208f53a91aeab09b933e3544ec29919ce1 (patch)
tree1aa7f5fe667b2d65cf3482a5488539d7d25cec90 /apps/alarm_menu.c
parent59eb461f8255b636800c120d7640d10d6a15e175 (diff)
downloadrockbox-a83ffb208f53a91aeab09b933e3544ec29919ce1.tar.gz
rockbox-a83ffb208f53a91aeab09b933e3544ec29919ce1.tar.bz2
rockbox-a83ffb208f53a91aeab09b933e3544ec29919ce1.zip
A proper alarm clock for the V2/FM (and v1 with mod)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5818 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/alarm_menu.c')
-rw-r--r--apps/alarm_menu.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/apps/alarm_menu.c b/apps/alarm_menu.c
index 20b2f51821..47d2c1226b 100644
--- a/apps/alarm_menu.c
+++ b/apps/alarm_menu.c
@@ -82,20 +82,11 @@ bool alarm_screen(void)
lcd_update();
rtc_init();
rtc_set_alarm(h,m);
- /* in some cases enabling the alarm results in an activated AF flag */
- /* this should not happen, but it does */
- /* if you know why, tell me! */
- /* for now, we try again forever in this case */
- while (rtc_enable_alarm(true)) { /* error occured */
- sleep(HZ / 10);
- rtc_init();
- rtc_set_alarm(h,m);
- }
- sleep(HZ);
+ rtc_enable_alarm(true);
lcd_puts(0,1,str(LANG_ALARM_MOD_SHUTDOWN));
lcd_update();
sleep(HZ);
- power_off();
+ done = true;
} else {
lcd_clear_display();
lcd_puts(0,0,str(LANG_ALARM_MOD_ERROR));
@@ -150,6 +141,11 @@ bool alarm_screen(void)
case BUTTON_STOP:
case BUTTON_MENU:
#endif
+ lcd_clear_display();
+ lcd_puts(0,0,str(LANG_ALARM_MOD_DISABLE));
+ lcd_update();
+ sleep(HZ);
+ rtc_enable_alarm(false);
done = true;
break;
}