Improve BackLt (35/63)

This commit is contained in:
Armel FAUVEAU
2024-04-05 05:03:40 +02:00
parent a562ff8479
commit d489dedf51
9 changed files with 29 additions and 30 deletions

View File

@@ -312,18 +312,6 @@ const char * const gSubMenu_F_LOCK[] =
"UNLOCK\nALL",
};
const char gSubMenu_BACKLIGHT[][7] =
{
"OFF",
"5 sec",
"10 sec",
"20 sec",
"1 min",
"2 min",
"4 min",
"ON"
};
const char gSubMenu_RX_TX[][6] =
{
"OFF",
@@ -668,7 +656,23 @@ void UI_DisplayMenu(void)
#endif
case MENU_ABR:
strcpy(String, gSubMenu_BACKLIGHT[gSubMenuSelection]);
if(gSubMenuSelection == 0)
{
sprintf(String, "%s", "OFF");
}
else if(gSubMenuSelection < 12)
{
sprintf(String, "%d sec", gSubMenuSelection * 5);
}
else if(gSubMenuSelection < 17)
{
sprintf(String, "%d min", gSubMenuSelection - 11);
}
else
{
sprintf(String, "%s", "ON");
}
if(BACKLIGHT_GetBrightness() < 4)
BACKLIGHT_SetBrightness(4);
break;