Selective backlight add CONTEXT_MAINMENU

I think its better to just limit this to the mainmenu rather than all contexts

Change-Id: If734a9516b14ec96d9e32beceba22419c47c0720
This commit is contained in:
William Wilgus 2022-12-08 21:28:08 -05:00 committed by William Wilgus
parent b63f4c5884
commit fc18235323
2 changed files with 10 additions and 9 deletions

View file

@ -125,7 +125,7 @@ static bool is_action_filtered(int action, unsigned int mask, int context)
{ {
case ACTION_NONE: case ACTION_NONE:
break; 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: case ACTION_UNKNOWN:
match = has_flag(mask, SEL_ACTION_NOUNMAPPED); match = has_flag(mask, SEL_ACTION_NOUNMAPPED);
break; break;
@ -133,15 +133,15 @@ static bool is_action_filtered(int action, unsigned int mask, int context)
case ACTION_FM_PLAY: case ACTION_FM_PLAY:
match = has_flag(mask, SEL_ACTION_PLAY); match = has_flag(mask, SEL_ACTION_PLAY);
break; break;
//case ACTION_STD_PREVREPEAT: // seek not exempted outside of WPS /* case ACTION_STD_PREVREPEAT:*/ /* seek not exempted outside of WPS */
//case ACTION_STD_NEXTREPEAT: /* case ACTION_STD_NEXTREPEAT: */
case ACTION_WPS_SEEKBACK: case ACTION_WPS_SEEKBACK:
case ACTION_WPS_SEEKFWD: case ACTION_WPS_SEEKFWD:
case ACTION_WPS_STOPSEEK: case ACTION_WPS_STOPSEEK:
match = has_flag(mask, SEL_ACTION_SEEK); match = has_flag(mask, SEL_ACTION_SEEK);
break; break;
//case ACTION_STD_PREV: // skip/scrollwheel not exempted outside of WPS /* case ACTION_STD_PREV: */ /* skip/scrollwheel not */
//case ACTION_STD_NEXT: /* case ACTION_STD_NEXT: */ /* exempted outside of WPS */
case ACTION_WPS_SKIPNEXT: case ACTION_WPS_SKIPNEXT:
case ACTION_WPS_SKIPPREV: case ACTION_WPS_SKIPPREV:
case ACTION_FM_NEXT_PRESET: 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); match = has_flag(mask, SEL_ACTION_SKIP);
break; break;
#ifdef HAVE_VOLUME_IN_LIST #ifdef HAVE_VOLUME_IN_LIST
case ACTION_LIST_VOLUP: // volume exempted outside of WPS if the device supports it case ACTION_LIST_VOLUP: /* volume exempted outside of WPS */
case ACTION_LIST_VOLDOWN: case ACTION_LIST_VOLDOWN: /* ( if the device supports it )*/
#endif #endif
case ACTION_WPS_VOLUP: case ACTION_WPS_VOLUP:
case ACTION_WPS_VOLDOWN: 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()); && power_input_present());
#endif #endif
/* skip if backlight on | incorrect context | SEL_ACTION_NOEXT + ext pwr */ /* 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); filtered = is_action_filtered(action, last->backlight_mask, cur->context);
bl_activate = !is_action_discarded(cur, filtered, &last->bl_filter_tick); bl_activate = !is_action_discarded(cur, filtered, &last->bl_filter_tick);

View file

@ -95,7 +95,7 @@ void set_selective_backlight_actions(bool selective, unsigned int mask,
enum { enum {
CONTEXT_STD = 0, CONTEXT_STD = 0,
/* These CONTEXT_ values were here before me, /* 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_WPS = 1,
CONTEXT_TREE = 2, CONTEXT_TREE = 2,
CONTEXT_RECORD = 3, CONTEXT_RECORD = 3,