From 5fadf4c6f3712b85d96d5e4f29edbbb5a7787241 Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Sat, 10 Feb 2024 00:52:39 +0100 Subject: [PATCH] Clean SCRAMBLER again...and save 200 octets --- app/app.c | 4 ++++ functions.c | 4 ++++ radio.c | 8 +++++++- ui/main.c | 2 ++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/app.c b/app/app.c index 46e1ee7..7a8201d 100644 --- a/app/app.c +++ b/app/app.c @@ -1866,10 +1866,14 @@ static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) BK4819_ExitDTMF_TX(false); +#ifndef ENABLE_FEAT_F4HWN if (gCurrentVfo->SCRAMBLING_TYPE == 0 || !gSetting_ScrambleEnable) BK4819_DisableScramble(); else BK4819_EnableScramble(gCurrentVfo->SCRAMBLING_TYPE - 1); +#else + BK4819_DisableScramble(); +#endif } } else { diff --git a/functions.c b/functions.c index e4f631b..088fe67 100644 --- a/functions.c +++ b/functions.c @@ -214,10 +214,14 @@ void FUNCTION_Transmit() } #endif +#ifdef ENABLE_FEAT_F4HWN + BK4819_DisableScramble(); +#else if (gCurrentVfo->SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable) BK4819_EnableScramble(gCurrentVfo->SCRAMBLING_TYPE - 1); else BK4819_DisableScramble(); +#endif if (gSetting_backlight_on_tx_rx & BACKLIGHT_ON_TR_TX) { BACKLIGHT_TurnOn(); diff --git a/radio.c b/radio.c index 251e50a..a0eebaa 100644 --- a/radio.c +++ b/radio.c @@ -235,8 +235,10 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure #ifndef ENABLE_FEAT_F4HWN if (tmp > (ARRAY_SIZE(gSubMenu_SCRAMBLER) - 1)) tmp = 0; -#endif pVfo->SCRAMBLING_TYPE = tmp; +#else + pVfo->SCRAMBLING_TYPE = 0; +#endif pVfo->freq_config_RX.CodeType = (data[2] >> 0) & 0x0F; pVfo->freq_config_TX.CodeType = (data[2] >> 4) & 0x0F; @@ -711,10 +713,14 @@ void RADIO_SetupRegisters(bool switchToForeground) break; } +#ifndef ENABLE_FEAT_F4HWN if (gRxVfo->SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable) BK4819_EnableScramble(gRxVfo->SCRAMBLING_TYPE - 1); else BK4819_DisableScramble(); +#else + BK4819_DisableScramble(); +#endif } } #ifdef ENABLE_NOAA diff --git a/ui/main.c b/ui/main.c index c929f35..f2af5d6 100644 --- a/ui/main.c +++ b/ui/main.c @@ -967,9 +967,11 @@ void UI_DisplayMain(void) UI_PrintStringSmallNormal("DTMF", LCD_WIDTH + 78, 0, line + 1); #endif +#ifndef ENABLE_FEAT_F4HWN // show the audio scramble symbol if (vfoInfo->SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable) UI_PrintStringSmallNormal("SCR", LCD_WIDTH + 106, 0, line + 1); +#endif #ifdef ENABLE_FEAT_F4HWN if(isMainVFO)