Clean SCRAMBLER again...and save 200 octets

This commit is contained in:
Armel FAUVEAU
2024-02-10 00:52:39 +01:00
parent 3cecf8b975
commit 5fadf4c6f3
4 changed files with 17 additions and 1 deletions

View File

@@ -1866,10 +1866,14 @@ static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
BK4819_ExitDTMF_TX(false); BK4819_ExitDTMF_TX(false);
#ifndef ENABLE_FEAT_F4HWN
if (gCurrentVfo->SCRAMBLING_TYPE == 0 || !gSetting_ScrambleEnable) if (gCurrentVfo->SCRAMBLING_TYPE == 0 || !gSetting_ScrambleEnable)
BK4819_DisableScramble(); BK4819_DisableScramble();
else else
BK4819_EnableScramble(gCurrentVfo->SCRAMBLING_TYPE - 1); BK4819_EnableScramble(gCurrentVfo->SCRAMBLING_TYPE - 1);
#else
BK4819_DisableScramble();
#endif
} }
} }
else { else {

View File

@@ -214,10 +214,14 @@ void FUNCTION_Transmit()
} }
#endif #endif
#ifdef ENABLE_FEAT_F4HWN
BK4819_DisableScramble();
#else
if (gCurrentVfo->SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable) if (gCurrentVfo->SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable)
BK4819_EnableScramble(gCurrentVfo->SCRAMBLING_TYPE - 1); BK4819_EnableScramble(gCurrentVfo->SCRAMBLING_TYPE - 1);
else else
BK4819_DisableScramble(); BK4819_DisableScramble();
#endif
if (gSetting_backlight_on_tx_rx & BACKLIGHT_ON_TR_TX) { if (gSetting_backlight_on_tx_rx & BACKLIGHT_ON_TR_TX) {
BACKLIGHT_TurnOn(); BACKLIGHT_TurnOn();

View File

@@ -235,8 +235,10 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure
#ifndef ENABLE_FEAT_F4HWN #ifndef ENABLE_FEAT_F4HWN
if (tmp > (ARRAY_SIZE(gSubMenu_SCRAMBLER) - 1)) if (tmp > (ARRAY_SIZE(gSubMenu_SCRAMBLER) - 1))
tmp = 0; tmp = 0;
#endif
pVfo->SCRAMBLING_TYPE = tmp; pVfo->SCRAMBLING_TYPE = tmp;
#else
pVfo->SCRAMBLING_TYPE = 0;
#endif
pVfo->freq_config_RX.CodeType = (data[2] >> 0) & 0x0F; pVfo->freq_config_RX.CodeType = (data[2] >> 0) & 0x0F;
pVfo->freq_config_TX.CodeType = (data[2] >> 4) & 0x0F; pVfo->freq_config_TX.CodeType = (data[2] >> 4) & 0x0F;
@@ -711,10 +713,14 @@ void RADIO_SetupRegisters(bool switchToForeground)
break; break;
} }
#ifndef ENABLE_FEAT_F4HWN
if (gRxVfo->SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable) if (gRxVfo->SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable)
BK4819_EnableScramble(gRxVfo->SCRAMBLING_TYPE - 1); BK4819_EnableScramble(gRxVfo->SCRAMBLING_TYPE - 1);
else else
BK4819_DisableScramble(); BK4819_DisableScramble();
#else
BK4819_DisableScramble();
#endif
} }
} }
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA

View File

@@ -967,9 +967,11 @@ void UI_DisplayMain(void)
UI_PrintStringSmallNormal("DTMF", LCD_WIDTH + 78, 0, line + 1); UI_PrintStringSmallNormal("DTMF", LCD_WIDTH + 78, 0, line + 1);
#endif #endif
#ifndef ENABLE_FEAT_F4HWN
// show the audio scramble symbol // show the audio scramble symbol
if (vfoInfo->SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable) if (vfoInfo->SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable)
UI_PrintStringSmallNormal("SCR", LCD_WIDTH + 106, 0, line + 1); UI_PrintStringSmallNormal("SCR", LCD_WIDTH + 106, 0, line + 1);
#endif
#ifdef ENABLE_FEAT_F4HWN #ifdef ENABLE_FEAT_F4HWN
if(isMainVFO) if(isMainVFO)