summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/misc.c5
-rw-r--r--apps/tree.c26
2 files changed, 20 insertions, 11 deletions
diff --git a/apps/misc.c b/apps/misc.c
index 96d23a8..5be6264 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -217,6 +217,7 @@ bool clean_shutdown(void)
{
lcd_clear_display();
splash(0, true, str(LANG_SHUTTINGDOWN));
+ sleep(HZ);
mpeg_stop();
ata_flush();
ata_spindown(1);
@@ -239,6 +240,10 @@ int default_event_handler(int event)
#endif
usb_screen();
return SYS_USB_CONNECTED;
+ case SYS_POWEROFF:
+ if (!clean_shutdown())
+ return SYS_POWEROFF;
+ break;
}
return 0;
}
diff --git a/apps/tree.c b/apps/tree.c
index 1a92dfd..03c7d2c 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -946,21 +946,25 @@ static bool dirbrowse(const char *root, const int *dirfilter)
break;
#ifdef TREE_OFF
+#ifndef HAVE_SW_POWEROFF
case TREE_OFF:
- /* Stop the music if it is playing, else show the shutdown
- screen */
- if(mpeg_status())
- mpeg_stop();
- else {
- if (!charger_inserted()) {
- shutdown_screen();
- } else {
- charging_splash();
+ if (*dirfilter < NUM_FILTER_MODES)
+ {
+ /* Stop the music if it is playing, else show the shutdown
+ screen */
+ if(mpeg_status())
+ mpeg_stop();
+ else {
+ if (!charger_inserted()) {
+ shutdown_screen();
+ } else {
+ charging_splash();
+ }
+ restore = true;
}
- restore = true;
}
break;
-
+#endif
case TREE_OFF | BUTTON_REPEAT:
if (charger_inserted()) {
charging_splash();