From c5e34c4be9b84b7f14ef73a33443a833623da1a4 Mon Sep 17 00:00:00 2001 From: Krzysiek Egzmont Date: Fri, 3 Nov 2023 16:39:25 +0100 Subject: [PATCH] Delete immediate applying of CTCSS/DCS while scrolling options in the menu. This also caused the option change not to be discarded on EXIT --- ui/menu.c | 39 +++++---------------------------------- 1 file changed, 5 insertions(+), 34 deletions(-) diff --git a/ui/menu.c b/ui/menu.c index 54f8959..4f64048 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -509,8 +509,7 @@ void UI_DisplayMenu(void) case MENU_T_DCS: if (gSubMenuSelection == 0) strcpy(String, "OFF"); - else - if (gSubMenuSelection < 105) + else if (gSubMenuSelection < 105) sprintf(String, "D%03oN", DCS_Options[gSubMenuSelection - 1]); else sprintf(String, "D%03oI", DCS_Options[gSubMenuSelection - 105]); @@ -519,38 +518,10 @@ void UI_DisplayMenu(void) case MENU_R_CTCS: case MENU_T_CTCS: { - #if 1 - unsigned int Code; - FREQ_Config_t *pConfig = (GetCurrentMenuId() == MENU_R_CTCS) ? &gTxVfo->freq_config_RX : &gTxVfo->freq_config_TX; - if (gSubMenuSelection == 0) - { - strcpy(String, "OFF"); - - if (pConfig->CodeType != CODE_TYPE_CONTINUOUS_TONE) - break; - Code = 0; - pConfig->CodeType = CODE_TYPE_OFF; - pConfig->Code = Code; - - BK4819_ExitSubAu(); - } - else - { - sprintf(String, "%u.%uHz", CTCSS_Options[gSubMenuSelection - 1] / 10, CTCSS_Options[gSubMenuSelection - 1] % 10); - - pConfig->CodeType = CODE_TYPE_CONTINUOUS_TONE; - Code = gSubMenuSelection - 1; - pConfig->Code = Code; - - BK4819_SetCTCSSFrequency(CTCSS_Options[Code]); - } - #else - if (gSubMenuSelection == 0) - strcpy(String, "OFF"); - else - sprintf(String, "%u.%uHz", CTCSS_Options[gSubMenuSelection - 1] / 10, CTCSS_Options[gSubMenuSelection - 1] % 10); - #endif - + if (gSubMenuSelection == 0) + strcpy(String, "OFF"); + else + sprintf(String, "%u.%uHz", CTCSS_Options[gSubMenuSelection - 1] / 10, CTCSS_Options[gSubMenuSelection - 1] % 10); break; }