Add F + UP / DOWN to change Squelch

This commit is contained in:
Armel FAUVEAU
2024-02-09 01:36:44 +01:00
parent 51131aaacd
commit dfe301b2dd
2 changed files with 32 additions and 1 deletions

View File

@@ -206,7 +206,7 @@ ifeq ($(ENABLE_FEAT_F4HWN),1)
VERSION_STRING_1 ?= v0.22 VERSION_STRING_1 ?= v0.22
AUTHOR_STRING_2 ?= F4HWN AUTHOR_STRING_2 ?= F4HWN
VERSION_STRING_2 ?= v1.7 VERSION_STRING_2 ?= v1.8
AUTHOR_STRING ?= $(AUTHOR_STRING_1)+$(AUTHOR_STRING_2) AUTHOR_STRING ?= $(AUTHOR_STRING_1)+$(AUTHOR_STRING_2)
VERSION_STRING ?= $(VERSION_STRING_2) VERSION_STRING ?= $(VERSION_STRING_2)

View File

@@ -250,6 +250,21 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
break; break;
#ifdef ENABLE_FEAT_F4HWN // Set Squelch F + UP or Down
case KEY_UP:
gEeprom.SQUELCH_LEVEL = (gEeprom.SQUELCH_LEVEL < 9) ? gEeprom.SQUELCH_LEVEL + 1: 9;
gVfoConfigureMode = VFO_CONFIGURE;
//gRequestDisplayScreen = DISPLAY_MAIN;
gWasFKeyPressed = false;
break;
case KEY_DOWN:
gEeprom.SQUELCH_LEVEL = (gEeprom.SQUELCH_LEVEL > 0) ? gEeprom.SQUELCH_LEVEL - 1: 0;
gVfoConfigureMode = VFO_CONFIGURE;
//gRequestDisplayScreen = DISPLAY_MAIN;
gWasFKeyPressed = false;
break;
#endif
default: default:
gUpdateStatus = true; gUpdateStatus = true;
gWasFKeyPressed = false; gWasFKeyPressed = false;
@@ -600,6 +615,22 @@ static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction) static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
{ {
#ifdef ENABLE_FEAT_F4HWN // Set Squelch F + UP or Down
if(gWasFKeyPressed) {
switch(Direction)
{
case 1:
processFKeyFunction(KEY_UP, false);
break;
case -1:
processFKeyFunction(KEY_DOWN, false);
break;
}
return;
}
#endif
uint8_t Channel = gEeprom.ScreenChannel[gEeprom.TX_VFO]; uint8_t Channel = gEeprom.ScreenChannel[gEeprom.TX_VFO];
if (bKeyHeld || !bKeyPressed) { // key held or released if (bKeyHeld || !bKeyPressed) { // key held or released