0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-20 06:58:39 +03:00

Fixed power save and added display contrast menu

This commit is contained in:
OneOfEleven
2023-10-10 03:56:28 +01:00
parent a552b040d8
commit 6660d0078f
19 changed files with 219 additions and 132 deletions

View File

@ -31,6 +31,7 @@
#include "driver/eeprom.h"
#include "driver/gpio.h"
#include "driver/keyboard.h"
#include "driver/st7565.h"
#include "frequencies.h"
#include "helper/battery.h"
#include "misc.h"
@ -214,6 +215,13 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
*pMax = ARRAY_SIZE(g_sub_menu_rx_tx) - 1;
break;
case MENU_CONTRAST:
// *pMin = 0;
// *pMax = 63;
*pMin = 26;
*pMax = 45;
break;
#ifdef ENABLE_AM_FIX_TEST1
case MENU_AM_FIX_TEST1:
*pMin = 0;
@ -537,6 +545,11 @@ void MENU_AcceptSetting(void)
g_setting_backlight_on_tx_rx = g_sub_menu_selection;
break;
case MENU_CONTRAST:
g_setting_contrast = g_sub_menu_selection;
ST7565_SetContrast(g_setting_contrast);
break;
case MENU_TDR:
// g_eeprom.dual_watch = g_sub_menu_selection;
g_eeprom.dual_watch = (g_sub_menu_selection > 0) ? 1 + g_eeprom.tx_vfo : DUAL_WATCH_OFF;
@ -1003,6 +1016,10 @@ void MENU_ShowCurrentSetting(void)
g_sub_menu_selection = g_setting_backlight_on_tx_rx;
break;
case MENU_CONTRAST:
g_sub_menu_selection = g_setting_contrast;
break;
case MENU_TDR:
// g_sub_menu_selection = g_eeprom.dual_watch;
g_sub_menu_selection = (g_eeprom.dual_watch == DUAL_WATCH_OFF) ? 0 : 1;