Revert BackLight Action and add 2 new buttons shortcuts

This commit is contained in:
Armel FAUVEAU
2024-03-12 04:46:26 +01:00
parent 4b34313c20
commit 5200915c13
7 changed files with 49 additions and 6 deletions

View File

@@ -491,15 +491,34 @@ void ACTION_Wn(void)
void ACTION_BackLight(void)
{
gBackLight = true;
if(gBacklightBrightnessOld == gEeprom.BACKLIGHT_MAX)
if(gBackLight)
{
gEeprom.BACKLIGHT_TIME = 0;
gEeprom.BACKLIGHT_TIME = gBacklightTimeOriginal;
}
gBackLight = false;
BACKLIGHT_TurnOn();
}
void ACTION_BackLightOnDemand(void)
{
if(gBackLight == false)
{
gBacklightTimeOriginal = gEeprom.BACKLIGHT_TIME;
gEeprom.BACKLIGHT_TIME = 7;
gBackLight = true;
}
else
{
gEeprom.BACKLIGHT_TIME = 7;
if(gBacklightBrightnessOld == gEeprom.BACKLIGHT_MAX)
{
gEeprom.BACKLIGHT_TIME = 0;
}
else
{
gEeprom.BACKLIGHT_TIME = 7;
}
}
BACKLIGHT_TurnOn();
}
#endif

View File

@@ -39,6 +39,7 @@ void ACTION_SwitchDemodul(void);
void ACTION_RxMode(void);
void ACTION_Ptt(void);
void ACTION_Wn(void);
void ACTION_BackLightOnDemand(void);
void ACTION_BackLight(void);
#endif

View File

@@ -456,6 +456,17 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
gWasFKeyPressed = false;
gUpdateStatus = true;
if(Key == 8)
{
ACTION_BackLightOnDemand();
return;
}
else if(Key == 9)
{
ACTION_BackLight();
return;
}
processFKeyFunction(Key, true);
}

View File

@@ -1010,7 +1010,18 @@ void MENU_ShowCurrentSetting(void)
#endif
case MENU_ABR:
gSubMenuSelection = gEeprom.BACKLIGHT_TIME;
#ifdef ENABLE_FEAT_F4HWN
if(gBackLight)
{
gSubMenuSelection = gBacklightTimeOriginal;
}
else
{
gSubMenuSelection = gEeprom.BACKLIGHT_TIME;
}
#else
gSubMenuSelection = gEeprom.BACKLIGHT_TIME;
#endif
break;
case MENU_ABR_MIN:

1
misc.c
View File

@@ -277,6 +277,7 @@ uint8_t gIsLocked = 0xFF;
#ifdef ENABLE_FEAT_F4HWN
bool gBackLight = false;
uint8_t gBacklightTimeOriginal;
uint8_t gPttOnePushCounter = 0;
uint32_t gBlinkCounter = 0;
#endif

1
misc.h
View File

@@ -344,6 +344,7 @@ extern volatile uint8_t boot_counter_10ms;
#ifdef ENABLE_FEAT_F4HWN
extern bool gBackLight;
extern uint8_t gBacklightTimeOriginal;
extern uint8_t gPttOnePushCounter;
extern uint32_t gBlinkCounter;
#endif

View File

@@ -424,7 +424,6 @@ const t_sidefunction gSubMenu_SIDEFUNCTIONS[] =
{"SWITCH\nRX MODE", ACTION_OPT_RXMODE},
{"SWITCH\nPTT", ACTION_OPT_PTT},
{"SWITCH\nWIDE\nNARROW", ACTION_OPT_WN},
{"SWITCH\nBACKLIGHT", ACTION_OPT_BACKLIGHT},
#endif
};