0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-05-03 16:51: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" * "TXP" menu, renamed to "TX-PWR"
* "SAVE" menu, renamed to "B-SAVE" * "SAVE" menu, renamed to "B-SAVE"
* "WX" menu, renamed to "CROS-B" - 'WX' normally means weather here in the UK * "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" * "SCR" menu, renamed to "SCRAM"
* "MIC" menu, shows mic gain in dB's, now includes the max mic gain possible (+15.5dB) * "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 * "VOL" menu, renamed to "BATVOL", shows voltage and percentage

View File

@ -1301,7 +1301,8 @@ void APP_TimeSlice500ms(void)
{ {
if (gBacklightCountdown) if (gBacklightCountdown)
if (--gBacklightCountdown == 0) 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 #ifndef DISABLE_AIRCOPY
if (gScreenToDisplay != DISPLAY_AIRCOPY && (gScreenToDisplay != DISPLAY_SCANNER || gScanCssState >= SCAN_CSS_STATE_FOUND)) if (gScreenToDisplay != DISPLAY_AIRCOPY && (gScreenToDisplay != DISPLAY_SCANNER || gScanCssState >= SCAN_CSS_STATE_FOUND))
@ -1397,7 +1398,8 @@ void APP_TimeSlice500ms(void)
gReducedService = true; gReducedService = true;
FUNCTION_Select(FUNCTION_POWER_SAVE); FUNCTION_Select(FUNCTION_POWER_SAVE);
ST7565_Configure_GPIO_B11(); 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 #ifndef DISABLE_VOICE
else else

View File

@ -23,7 +23,7 @@ uint8_t gBacklightCountdown;
void BACKLIGHT_TurnOn(void) void BACKLIGHT_TurnOn(void)
{ {
if (gEeprom.BACKLIGHT) if (gEeprom.BACKLIGHT > 0)
{ {
GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT);
#if 0 #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) if (!gChargingWithTypeC && !gBatteryDisplayLevel)
{ {
FUNCTION_Select(FUNCTION_POWER_SAVE); 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; gReducedService = true;
} }
else else

View File

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