From dfe301b2ddfe2d3036726046477888af62ca4f8b Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Fri, 9 Feb 2024 01:36:44 +0100 Subject: [PATCH] Add F + UP / DOWN to change Squelch --- Makefile | 2 +- app/main.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 214c5e5..a806e9f 100644 --- a/Makefile +++ b/Makefile @@ -206,7 +206,7 @@ ifeq ($(ENABLE_FEAT_F4HWN),1) VERSION_STRING_1 ?= v0.22 AUTHOR_STRING_2 ?= F4HWN - VERSION_STRING_2 ?= v1.7 + VERSION_STRING_2 ?= v1.8 AUTHOR_STRING ?= $(AUTHOR_STRING_1)+$(AUTHOR_STRING_2) VERSION_STRING ?= $(VERSION_STRING_2) diff --git a/app/main.c b/app/main.c index a0431cc..fe329f8 100644 --- a/app/main.c +++ b/app/main.c @@ -250,6 +250,21 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep) gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; 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: gUpdateStatus = true; 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) { + +#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]; if (bKeyHeld || !bKeyPressed) { // key held or released