0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-05-19 08:21:18 +03:00

Menu timeout to 30 seconds

This commit is contained in:
OneOfEleven 2023-09-11 11:56:59 +01:00
parent cff04127d3
commit 6a1b7d8673
7 changed files with 23 additions and 19 deletions

View File

@ -64,13 +64,13 @@ make
To compile directly in windows without the need of a linux virtual machine: To compile directly in windows without the need of a linux virtual machine:
``` ```
* Download and install "gcc-arm-none-eabi-10.3-2021.10-win32.exe" from https://developer.arm.com/downloads/-/gnu-rm 1. Download and install "gcc-arm-none-eabi-10.3-2021.10-win32.exe" from https://developer.arm.com/downloads/-/gnu-rm
* Download and install "gnu_make-3.81.exe" from https://gnuwin32.sourceforge.net/packages/make.htm 2. Download and install "gnu_make-3.81.exe" from https://gnuwin32.sourceforge.net/packages/make.htm
3. You may (or may not) need to reboot your PC after installing the above
``` ```
You may (or may not) need to reboot your PC after installing the above. Then you can run 'win_make.bat' from the directory you saved this source code too.
You may need to edit the bat file (path to make.exe) depending on where you installed 'gnu_make' too.
Run 'win_make.bat' from the directory you saved this source code too, you may have to edit the bat file depending on where you installed 'gnu_make' too
# Credits # Credits

View File

@ -1280,18 +1280,21 @@ void APP_TimeSlice500ms(void)
{ {
// Skipped authentic device check // Skipped authentic device check
if (gBacklightCountdown > 0) if (gCurrentFunction != FUNCTION_TRANSMIT)
if (--gBacklightCountdown == 0) {
if (gEeprom.BACKLIGHT < 5) if (gBacklightCountdown > 0)
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn backlight off if (--gBacklightCountdown == 0)
if (gEeprom.BACKLIGHT < 5)
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn backlight off
}
if (gKeypadLocked) if (gKeypadLocked > 0)
if (--gKeypadLocked == 0) if (--gKeypadLocked == 0)
gUpdateDisplay = true; gUpdateDisplay = true;
// Skipped authentic device check // Skipped authentic device check
if (gFmRadioCountdown) if (gFmRadioCountdown > 0)
{ {
gFmRadioCountdown--; gFmRadioCountdown--;
return; return;
@ -1326,7 +1329,7 @@ void APP_TimeSlice500ms(void)
gCurrentRSSI = BK4819_GetRSSI(); gCurrentRSSI = BK4819_GetRSSI();
UI_UpdateRSSI(gCurrentRSSI); UI_UpdateRSSI(gCurrentRSSI);
} }
else // else
{ {
if ((gFM_ScanState == FM_SCAN_OFF || gAskToSave) && gScanState == SCAN_OFF && gCssScanMode == CSS_SCAN_MODE_OFF) if ((gFM_ScanState == FM_SCAN_OFF || gAskToSave) && gScanState == SCAN_OFF && gCssScanMode == CSS_SCAN_MODE_OFF)
{ {
@ -1344,7 +1347,7 @@ void APP_TimeSlice500ms(void)
gUpdateStatus = true; gUpdateStatus = true;
} }
if (gVoltageMenuCountdown) if (gVoltageMenuCountdown > 0)
{ {
if (--gVoltageMenuCountdown == 0) if (--gVoltageMenuCountdown == 0)
{ {

View File

@ -1322,5 +1322,5 @@ void MENU_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
} }
if (gScreenToDisplay == DISPLAY_MENU && gMenuCursor == MENU_VOL) if (gScreenToDisplay == DISPLAY_MENU && gMenuCursor == MENU_VOL)
gVoltageMenuCountdown = 32; gVoltageMenuCountdown = 2 * 30; // 30 sec
} }

View File

@ -19,6 +19,7 @@
#include "driver/gpio.h" #include "driver/gpio.h"
#include "settings.h" #include "settings.h"
// this is decremented once every 500ms
uint8_t gBacklightCountdown = 0; uint8_t gBacklightCountdown = 0;
void BACKLIGHT_TurnOn(void) void BACKLIGHT_TurnOn(void)
@ -33,16 +34,16 @@ void BACKLIGHT_TurnOn(void)
{ {
default: default:
case 1: // 10 sec case 1: // 10 sec
gBacklightCountdown = 2 * 10; // 1 gBacklightCountdown = 2 * 10;
break; break;
case 2: // 20 sec case 2: // 20 sec
gBacklightCountdown = 2 * 20; // 21 gBacklightCountdown = 2 * 20;
break; break;
case 3: // 40 sec case 3: // 40 sec
gBacklightCountdown = 2 * 40; // 61 gBacklightCountdown = 2 * 40;
break; break;
case 4: // 80 sec case 4: // 80 sec
gBacklightCountdown = 2 * 80; // 141 gBacklightCountdown = 2 * 80;
break; break;
case 5: // always on case 5: // always on
gBacklightCountdown = 0; gBacklightCountdown = 0;

BIN
firmware

Binary file not shown.

Binary file not shown.

Binary file not shown.