mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
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
This commit is contained in:
parent
59eb461f82
commit
a83ffb208f
5 changed files with 62 additions and 23 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue