summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/tree.c10
-rw-r--r--apps/tree.h1
2 files changed, 6 insertions, 5 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 7d4ee7f703..b26221a0fe 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -649,14 +649,14 @@ static bool dirbrowse(void)
break;
#ifdef TREE_OFF
-#if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF)
case TREE_OFF:
if (*tc.dirfilter < NUM_FILTER_MODES)
{
- /* Stop the music if it is playing, else power off */
+ /* Stop the music if it is playing */
if(audio_status())
audio_stop();
- else {
+#if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF)
+ else {
if (!charger_inserted()) {
if(shutdown_screen())
reload_dir = true;
@@ -665,9 +665,9 @@ static bool dirbrowse(void)
}
restore = true;
}
+#endif
}
break;
-#endif
#if defined(HAVE_CHARGING) && !defined(HAVE_POWEROFF_WHILE_CHARGING)
case TREE_OFF | BUTTON_REPEAT:
if (charger_inserted()) {
@@ -676,7 +676,7 @@ static bool dirbrowse(void)
}
break;
#endif
-#endif
+#endif /* TREE_OFF */
case TREE_MENU:
#ifdef TREE_RC_MENU
case TREE_RC_MENU:
diff --git a/apps/tree.h b/apps/tree.h
index 04532c887d..00d22c4d24 100644
--- a/apps/tree.h
+++ b/apps/tree.h
@@ -107,6 +107,7 @@
#define TREE_RUN_PRE BUTTON_RIGHT
#define TREE_MENU (BUTTON_MENU | BUTTON_REPEAT)
#define TREE_MENU_PRE BUTTON_MENU
+#define TREE_OFF BUTTON_OFF
#define TREE_WPS (BUTTON_MENU | BUTTON_REL)
#define TREE_WPS_PRE BUTTON_MENU
#define TREE_CONTEXT (BUTTON_RIGHT | BUTTON_REPEAT)