mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-05-19 00:11:18 +03:00
Backlight improvement when set to off
This commit is contained in:
parent
1424ce8401
commit
fd7f09a3ff
13
app/app.c
13
app/app.c
@ -1825,9 +1825,10 @@ void APP_TimeSlice500ms(void)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (gBacklightCountdown > 0)
|
if (gBacklightCountdown > 0)
|
||||||
if (--gBacklightCountdown == 0)
|
if (gScreenToDisplay != DISPLAY_MENU || gMenuCursor != MENU_ABR) // don't turn off backlight if user is in backlight menu option
|
||||||
if (gEeprom.BACKLIGHT < 5)
|
if (--gBacklightCountdown == 0)
|
||||||
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn backlight off
|
if (gEeprom.BACKLIGHT < 5)
|
||||||
|
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn backlight off
|
||||||
|
|
||||||
#ifdef ENABLE_AIRCOPY
|
#ifdef ENABLE_AIRCOPY
|
||||||
if (gScanState == SCAN_OFF && gScreenToDisplay != DISPLAY_AIRCOPY && (gScreenToDisplay != DISPLAY_SCANNER || gScanCssState >= SCAN_CSS_STATE_FOUND))
|
if (gScanState == SCAN_OFF && gScreenToDisplay != DISPLAY_AIRCOPY && (gScreenToDisplay != DISPLAY_SCANNER || gScanCssState >= SCAN_CSS_STATE_FOUND))
|
||||||
@ -1847,6 +1848,12 @@ void APP_TimeSlice500ms(void)
|
|||||||
{
|
{
|
||||||
if (--gVoltageMenuCountdown == 0)
|
if (--gVoltageMenuCountdown == 0)
|
||||||
{
|
{
|
||||||
|
if (gEeprom.BACKLIGHT == 0 && gScreenToDisplay == DISPLAY_MENU)
|
||||||
|
{
|
||||||
|
gBacklightCountdown = 0;
|
||||||
|
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight OFF
|
||||||
|
}
|
||||||
|
|
||||||
if (gInputBoxIndex > 0 || gDTMF_InputMode || gScreenToDisplay == DISPLAY_MENU)
|
if (gInputBoxIndex > 0 || gDTMF_InputMode || gScreenToDisplay == DISPLAY_MENU)
|
||||||
AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL);
|
AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL);
|
||||||
|
|
||||||
|
28
app/menu.c
28
app/menu.c
@ -518,8 +518,6 @@ void MENU_AcceptSetting(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_ABR:
|
case MENU_ABR:
|
||||||
gEeprom.BACKLIGHT = 1; // turn the light on to let them find there way around for a bit
|
|
||||||
BACKLIGHT_TurnOn();
|
|
||||||
gEeprom.BACKLIGHT = gSubMenuSelection;
|
gEeprom.BACKLIGHT = gSubMenuSelection;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -908,15 +906,10 @@ void MENU_ShowCurrentSetting(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_ABR:
|
case MENU_ABR:
|
||||||
if (gEeprom.BACKLIGHT == 0)
|
|
||||||
{ // turn the light on so the user can see the screen
|
|
||||||
const uint8_t value = gEeprom.BACKLIGHT;
|
|
||||||
gEeprom.BACKLIGHT = 1;
|
|
||||||
BACKLIGHT_TurnOn();
|
|
||||||
gEeprom.BACKLIGHT = value; // restore the setting
|
|
||||||
}
|
|
||||||
|
|
||||||
gSubMenuSelection = gEeprom.BACKLIGHT;
|
gSubMenuSelection = gEeprom.BACKLIGHT;
|
||||||
|
|
||||||
|
gBacklightCountdown = 0;
|
||||||
|
GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight ON while in backlight menu
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_TDR:
|
case MENU_TDR:
|
||||||
@ -1287,6 +1280,12 @@ static void MENU_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||||
|
|
||||||
|
if (gEeprom.BACKLIGHT == 0)
|
||||||
|
{
|
||||||
|
gBacklightCountdown = 0;
|
||||||
|
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight OFF
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1597,6 +1596,13 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
|||||||
gMenuCursor = NUMBER_AddWithWraparound(gMenuCursor, -Direction, 0, gMenuListCount - 1);
|
gMenuCursor = NUMBER_AddWithWraparound(gMenuCursor, -Direction, 0, gMenuListCount - 1);
|
||||||
gFlagRefreshSetting = true;
|
gFlagRefreshSetting = true;
|
||||||
gRequestDisplayScreen = DISPLAY_MENU;
|
gRequestDisplayScreen = DISPLAY_MENU;
|
||||||
|
|
||||||
|
if (gMenuCursor != MENU_ABR && gEeprom.BACKLIGHT == 0)
|
||||||
|
{
|
||||||
|
gBacklightCountdown = 0;
|
||||||
|
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight OFF
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1632,7 +1638,7 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
|||||||
bCheckScanList = true;
|
bCheckScanList = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
MENU_ClampSelection(Direction);
|
MENU_ClampSelection(Direction);
|
||||||
gRequestDisplayScreen = DISPLAY_MENU;
|
gRequestDisplayScreen = DISPLAY_MENU;
|
||||||
return;
|
return;
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -395,14 +395,6 @@ void UI_DisplayMenu(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_ABR:
|
case MENU_ABR:
|
||||||
if (gEeprom.BACKLIGHT == 0)
|
|
||||||
{ // turn the light on so the user can see the screen
|
|
||||||
const uint8_t value = gEeprom.BACKLIGHT;
|
|
||||||
gEeprom.BACKLIGHT = 1;
|
|
||||||
BACKLIGHT_TurnOn();
|
|
||||||
gEeprom.BACKLIGHT = value; // restore the setting
|
|
||||||
}
|
|
||||||
|
|
||||||
strcpy(String, gSubMenu_BACK_LIGHT[gSubMenuSelection]);
|
strcpy(String, gSubMenu_BACK_LIGHT[gSubMenuSelection]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user