Skip to content

Commit

Permalink
Fix egzumer#275 Backlight does not get back to MAX brightness after e…
Browse files Browse the repository at this point in the history
…xiting backlight menu entries

Backlight is set to FULL when interacting with backlight menu entries,
but it is not set back to MAX when exiting from those entries. This
commit corrects that behaviour.
  • Loading branch information
JuantAldea committed Dec 15, 2023
1 parent a99d2dd commit bb9e76a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,10 @@ static void MENU_Key_EXIT(bool bKeyPressed, bool bKeyHeld)

if (!gCssBackgroundScan)
{
/* Backlight related menus set full brightness. Set it back to the configured value,
just in case we are exiting from one of them. */
BACKLIGHT_SetBrightness(gEeprom.BACKLIGHT_MAX);

if (gIsInSubMenu)
{
if (gInputBoxIndex == 0 || UI_MENU_GetCurrentMenuId() != MENU_OFFSET)
Expand Down
6 changes: 6 additions & 0 deletions ui/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,12 @@ void UI_DisplayMenu(void)

bool already_printed = false;

/* Brightness is set to max in some entries of this menu. Return it to the configured brightness
level the "next" time we enter here.I.e., when we move from one menu to another.
It also has to be set back to max when pressing the Exit key. */

BACKLIGHT_SetBrightness(gEeprom.BACKLIGHT_MAX);

switch (UI_MENU_GetCurrentMenuId())
{
case MENU_SQL:
Expand Down

0 comments on commit bb9e76a

Please sign in to comment.