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

Added always ON backlight menu option

This commit is contained in:
OneOfEleven 2023-09-10 14:07:23 +01:00
parent 16434c8d14
commit 37afeb0414
8 changed files with 11 additions and 5 deletions

View File

@ -34,7 +34,7 @@ To enable the custom option just uncomment the line by removing the starting '#'
* "TXP" menu, renamed to "TX-PWR"
* "SAVE" menu, renamed to "B-SAVE"
* "WX" menu, renamed to "CROS-B" - 'WX' normally means weather here in the UK
* "ABR" menu, renamed to "BAK-LT", shows extended backlight times
* "ABR" menu, renamed to "BAK-LT", shows extended backlight times, now has always ON option
* "SCR" menu, renamed to "SCRAM"
* "MIC" menu, shows mic gain in dB's, now includes the max mic gain possible (+15.5dB)
* "VOL" menu, renamed to "BATVOL", shows voltage and percentage

View File

@ -1301,7 +1301,8 @@ void APP_TimeSlice500ms(void)
{
if (gBacklightCountdown)
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
#ifndef DISABLE_AIRCOPY
if (gScreenToDisplay != DISPLAY_AIRCOPY && (gScreenToDisplay != DISPLAY_SCANNER || gScanCssState >= SCAN_CSS_STATE_FOUND))
@ -1397,7 +1398,8 @@ void APP_TimeSlice500ms(void)
gReducedService = true;
FUNCTION_Select(FUNCTION_POWER_SAVE);
ST7565_Configure_GPIO_B11();
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT);
//if (gEeprom.BACKLIGHT < 5)
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT);
}
#ifndef DISABLE_VOICE
else

View File

@ -23,7 +23,7 @@ uint8_t gBacklightCountdown;
void BACKLIGHT_TurnOn(void)
{
if (gEeprom.BACKLIGHT)
if (gEeprom.BACKLIGHT > 0)
{
GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT);
#if 0

BIN
firmware

Binary file not shown.

Binary file not shown.

Binary file not shown.

3
main.c
View File

@ -110,7 +110,8 @@ void Main(void)
if (!gChargingWithTypeC && !gBatteryDisplayLevel)
{
FUNCTION_Select(FUNCTION_POWER_SAVE);
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT);
//if (gEeprom.BACKLIGHT < 5)
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT);
gReducedService = true;
}
else

View File

@ -382,7 +382,10 @@ void UI_DisplayMenu(void)
if (gSubMenuSelection == 0)
strcpy(String, "OFF");
else
if (gSubMenuSelection < 5)
sprintf(String, "%d sec", gSubMenuSelection * 10);
else
strcpy(String, "ON");
break;
case MENU_AM: