diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/misc.c | 5 | ||||
-rw-r--r-- | apps/tree.c | 26 |
2 files changed, 20 insertions, 11 deletions
diff --git a/apps/misc.c b/apps/misc.c index 96d23a8388..5be6264fdc 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -217,6 +217,7 @@ bool clean_shutdown(void) | |||
217 | { | 217 | { |
218 | lcd_clear_display(); | 218 | lcd_clear_display(); |
219 | splash(0, true, str(LANG_SHUTTINGDOWN)); | 219 | splash(0, true, str(LANG_SHUTTINGDOWN)); |
220 | sleep(HZ); | ||
220 | mpeg_stop(); | 221 | mpeg_stop(); |
221 | ata_flush(); | 222 | ata_flush(); |
222 | ata_spindown(1); | 223 | ata_spindown(1); |
@@ -239,6 +240,10 @@ int default_event_handler(int event) | |||
239 | #endif | 240 | #endif |
240 | usb_screen(); | 241 | usb_screen(); |
241 | return SYS_USB_CONNECTED; | 242 | return SYS_USB_CONNECTED; |
243 | case SYS_POWEROFF: | ||
244 | if (!clean_shutdown()) | ||
245 | return SYS_POWEROFF; | ||
246 | break; | ||
242 | } | 247 | } |
243 | return 0; | 248 | return 0; |
244 | } | 249 | } |
diff --git a/apps/tree.c b/apps/tree.c index 1a92dfd3a9..03c7d2ca37 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -946,21 +946,25 @@ static bool dirbrowse(const char *root, const int *dirfilter) | |||
946 | break; | 946 | break; |
947 | 947 | ||
948 | #ifdef TREE_OFF | 948 | #ifdef TREE_OFF |
949 | #ifndef HAVE_SW_POWEROFF | ||
949 | case TREE_OFF: | 950 | case TREE_OFF: |
950 | /* Stop the music if it is playing, else show the shutdown | 951 | if (*dirfilter < NUM_FILTER_MODES) |
951 | screen */ | 952 | { |
952 | if(mpeg_status()) | 953 | /* Stop the music if it is playing, else show the shutdown |
953 | mpeg_stop(); | 954 | screen */ |
954 | else { | 955 | if(mpeg_status()) |
955 | if (!charger_inserted()) { | 956 | mpeg_stop(); |
956 | shutdown_screen(); | 957 | else { |
957 | } else { | 958 | if (!charger_inserted()) { |
958 | charging_splash(); | 959 | shutdown_screen(); |
960 | } else { | ||
961 | charging_splash(); | ||
962 | } | ||
963 | restore = true; | ||
959 | } | 964 | } |
960 | restore = true; | ||
961 | } | 965 | } |
962 | break; | 966 | break; |
963 | 967 | #endif | |
964 | case TREE_OFF | BUTTON_REPEAT: | 968 | case TREE_OFF | BUTTON_REPEAT: |
965 | if (charger_inserted()) { | 969 | if (charger_inserted()) { |
966 | charging_splash(); | 970 | charging_splash(); |