0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 14:21:25 +03:00

Fixed backlight = off exit problem

This commit is contained in:
OneOfEleven 2023-09-20 08:40:35 +01:00
parent af9b0d6cb7
commit 2e0571b600
6 changed files with 15 additions and 25 deletions

View File

@ -166,7 +166,7 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
case MENU_ABR:
*pMin = 0;
*pMax = 5;
*pMax = ARRAY_SIZE(gSubMenu_BACK_LIGHT) - 1;
break;
case MENU_F_LOCK:
@ -518,11 +518,9 @@ void MENU_AcceptSetting(void)
break;
case MENU_ABR:
gEeprom.BACKLIGHT = gSubMenuSelection;
if (gSubMenuSelection == 0)
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT);
else
gEeprom.BACKLIGHT = 1; // turn the light on to let them find there way around for a bit
BACKLIGHT_TurnOn();
gEeprom.BACKLIGHT = gSubMenuSelection;
break;
case MENU_TDR:

BIN
firmware

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -241,6 +241,16 @@ const char gSubMenu_F_LOCK[6][4] =
"438"
};
const char gSubMenu_BACK_LIGHT[6][7] =
{
"OFF",
"10 sec",
"20 sec",
"40 sec",
"80 sec",
"ON"
};
#ifdef ENABLE_COMPANDER
const char gSubMenu_Compand[4][6] =
{
@ -383,26 +393,7 @@ void UI_DisplayMenu(void)
break;
case MENU_ABR:
#if 0
if (gSubMenuSelection == 0)
strcpy(String, "OFF");
else
if (gSubMenuSelection < 5)
sprintf(String, "%d sec", gSubMenuSelection * 10);
else
strcpy(String, "ON");
#else
switch (gSubMenuSelection)
{
case 0: strcpy(String, "OFF"); break;
case 1: strcpy(String, "10 sec"); break;
case 2: strcpy(String, "20 sec"); break;
case 3: strcpy(String, "40 sec"); break;
case 4: strcpy(String, "80 sec"); break;
case 5: strcpy(String, "ON"); break;
default: strcpy(String, "???"); break;
}
#endif
strcpy(String, gSubMenu_BACK_LIGHT[gSubMenuSelection]);
break;
case MENU_AM:

View File

@ -121,6 +121,7 @@ extern const char gSubMenu_PONMSG[4][5];
extern const char gSubMenu_ROGER[3][6];
extern const char gSubMenu_RESET[2][4];
extern const char gSubMenu_F_LOCK[6][4];
extern const char gSubMenu_BACK_LIGHT[6][7];
#ifdef ENABLE_COMPANDER
extern const char gSubMenu_Compand[4][6];
#endif