summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-12-08 21:28:08 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2022-12-09 17:54:02 -0500
commitfc18235323d500b351f627dce4fce105ddd9a330 (patch)
tree72e693329c4e48c8f0c5d2a3af34efe90fdc5127
parentb63f4c588449f50ad427951f3512f8284a485012 (diff)
downloadrockbox-fc18235323.tar.gz
rockbox-fc18235323.zip
Selective backlight add CONTEXT_MAINMENU
I think its better to just limit this to the mainmenu rather than all contexts Change-Id: If734a9516b14ec96d9e32beceba22419c47c0720
-rw-r--r--apps/action.c17
-rw-r--r--apps/action.h2
2 files changed, 10 insertions, 9 deletions
diff --git a/apps/action.c b/apps/action.c
index 8c03ca4d65..e8c3e8675e 100644
--- a/apps/action.c
+++ b/apps/action.c
@@ -125,7 +125,7 @@ static bool is_action_filtered(int action, unsigned int mask, int context)
{
case ACTION_NONE:
break;
-/*Actions that are not mapped will not turn on the backlight option NOUNMAPPED*/
+ /* Actions that are not mapped will not turn on the backlight */
case ACTION_UNKNOWN:
match = has_flag(mask, SEL_ACTION_NOUNMAPPED);
break;
@@ -133,15 +133,15 @@ static bool is_action_filtered(int action, unsigned int mask, int context)
case ACTION_FM_PLAY:
match = has_flag(mask, SEL_ACTION_PLAY);
break;
- //case ACTION_STD_PREVREPEAT: // seek not exempted outside of WPS
- //case ACTION_STD_NEXTREPEAT:
+ /* case ACTION_STD_PREVREPEAT:*/ /* seek not exempted outside of WPS */
+ /* case ACTION_STD_NEXTREPEAT: */
case ACTION_WPS_SEEKBACK:
case ACTION_WPS_SEEKFWD:
case ACTION_WPS_STOPSEEK:
match = has_flag(mask, SEL_ACTION_SEEK);
break;
- //case ACTION_STD_PREV: // skip/scrollwheel not exempted outside of WPS
- //case ACTION_STD_NEXT:
+ /* case ACTION_STD_PREV: */ /* skip/scrollwheel not */
+ /* case ACTION_STD_NEXT: */ /* exempted outside of WPS */
case ACTION_WPS_SKIPNEXT:
case ACTION_WPS_SKIPPREV:
case ACTION_FM_NEXT_PRESET:
@@ -149,8 +149,8 @@ static bool is_action_filtered(int action, unsigned int mask, int context)
match = has_flag(mask, SEL_ACTION_SKIP);
break;
#ifdef HAVE_VOLUME_IN_LIST
- case ACTION_LIST_VOLUP: // volume exempted outside of WPS if the device supports it
- case ACTION_LIST_VOLDOWN:
+ case ACTION_LIST_VOLUP: /* volume exempted outside of WPS */
+ case ACTION_LIST_VOLDOWN: /* ( if the device supports it )*/
#endif
case ACTION_WPS_VOLUP:
case ACTION_WPS_VOLDOWN:
@@ -1001,7 +1001,8 @@ static inline int do_backlight(action_last_t *last, action_cur_t *cur, int actio
&& power_input_present());
#endif
/* skip if backlight on | incorrect context | SEL_ACTION_NOEXT + ext pwr */
- if ((cur->context == CONTEXT_FM || cur->context == CONTEXT_WPS) && bl_is_off)
+ if (bl_is_off && (cur->context == CONTEXT_FM || cur->context == CONTEXT_WPS ||
+ cur->context == CONTEXT_MAINMENU))
{
filtered = is_action_filtered(action, last->backlight_mask, cur->context);
bl_activate = !is_action_discarded(cur, filtered, &last->bl_filter_tick);
diff --git a/apps/action.h b/apps/action.h
index 444437edf8..a3c21ec8a6 100644
--- a/apps/action.h
+++ b/apps/action.h
@@ -95,7 +95,7 @@ void set_selective_backlight_actions(bool selective, unsigned int mask,
enum {
CONTEXT_STD = 0,
/* These CONTEXT_ values were here before me,
- there values may have significance, so dont touch! */
+ their values may have significance, so dont touch! */
CONTEXT_WPS = 1,
CONTEXT_TREE = 2,
CONTEXT_RECORD = 3,