From 91cb12f0f9f88b1854ae737fcd085fca669263ac Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Thu, 26 Sep 2024 00:22:36 +0200 Subject: [PATCH] Remove Tx200, Tx350 and Tx500 menus (obsolete with the new TXLock) --- app/menu.c | 12 ++++++++++-- frequencies.c | 8 ++++++++ misc.c | 8 +++++++- misc.h | 7 +++++++ settings.c | 10 ++++++++-- ui/menu.c | 4 ++++ ui/menu.h | 2 ++ 7 files changed, 46 insertions(+), 5 deletions(-) diff --git a/app/menu.c b/app/menu.c index 958dd60..17ae392 100644 --- a/app/menu.c +++ b/app/menu.c @@ -248,9 +248,11 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax) #ifdef ENABLE_NOAA case MENU_NOAA_S: #endif +#ifndef ENABLE_FEAT_F4HWN case MENU_350TX: case MENU_200TX: case MENU_500TX: +#endif case MENU_350EN: #ifndef ENABLE_FEAT_F4HWN case MENU_SCREN: @@ -795,9 +797,11 @@ void MENU_AcceptSetting(void) SETTINGS_FactoryReset(gSubMenuSelection); return; +#ifndef ENABLE_FEAT_F4HWN case MENU_350TX: gSetting_350TX = gSubMenuSelection; break; +#endif case MENU_F_LOCK: { if(gSubMenuSelection == F_LOCK_NONE) { // select 10 times to enable @@ -815,6 +819,7 @@ void MENU_AcceptSetting(void) gSetting_F_LOCK = gSubMenuSelection; break; } +#ifndef ENABLE_FEAT_F4HWN case MENU_200TX: gSetting_200TX = gSubMenuSelection; break; @@ -822,13 +827,12 @@ void MENU_AcceptSetting(void) case MENU_500TX: gSetting_500TX = gSubMenuSelection; break; - +#endif case MENU_350EN: gSetting_350EN = gSubMenuSelection; gVfoConfigureMode = VFO_CONFIGURE_RELOAD; gFlagResetVfos = true; break; - #ifndef ENABLE_FEAT_F4HWN case MENU_SCREN: gSetting_ScrambleEnable = gSubMenuSelection; @@ -1242,14 +1246,17 @@ void MENU_ShowCurrentSetting(void) #endif break; +#ifndef ENABLE_FEAT_F4HWN case MENU_350TX: gSubMenuSelection = gSetting_350TX; break; +#endif case MENU_F_LOCK: gSubMenuSelection = gSetting_F_LOCK; break; +#ifndef ENABLE_FEAT_F4HWN case MENU_200TX: gSubMenuSelection = gSetting_200TX; break; @@ -1258,6 +1265,7 @@ void MENU_ShowCurrentSetting(void) gSubMenuSelection = gSetting_500TX; break; +#endif case MENU_350EN: gSubMenuSelection = gSetting_350EN; break; diff --git a/frequencies.c b/frequencies.c index daad6ff..ac9953d 100644 --- a/frequencies.c +++ b/frequencies.c @@ -175,15 +175,23 @@ int32_t TX_freq_check(const uint32_t Frequency) if (Frequency >= frequencyBandTable[BAND3_137MHz].lower && Frequency < frequencyBandTable[BAND3_137MHz].upper) return 0; if (Frequency >= frequencyBandTable[BAND4_174MHz].lower && Frequency < frequencyBandTable[BAND4_174MHz].upper) + #ifndef ENABLE_FEAT_F4HWN if (gSetting_200TX) + #endif return 0; if (Frequency >= frequencyBandTable[BAND5_350MHz].lower && Frequency < frequencyBandTable[BAND5_350MHz].upper) + #ifndef ENABLE_FEAT_F4HWN if (gSetting_350TX && gSetting_350EN) + #else + if (gSetting_350EN) + #endif return 0; if (Frequency >= frequencyBandTable[BAND6_400MHz].lower && Frequency < frequencyBandTable[BAND6_400MHz].upper) return 0; if (Frequency >= frequencyBandTable[BAND7_470MHz].lower && Frequency <= 60000000) + #ifndef ENABLE_FEAT_F4HWN if (gSetting_500TX) + #endif return 0; break; diff --git a/misc.c b/misc.c index 0e0b476..5b34b20 100644 --- a/misc.c +++ b/misc.c @@ -88,12 +88,18 @@ const uint32_t gDefaultAesKey[4] = {0x4AA5CC60, 0x0312CC5F, 0x const uint8_t gMicGain_dB2[5] = {3, 8, 16, 24, 31}; -bool gSetting_350TX; +#ifndef ENABLE_FEAT_F4HWN + bool gSetting_350TX; +#endif + #ifdef ENABLE_DTMF_CALLING bool gSetting_KILLED; #endif + +#ifndef ENABLE_FEAT_F4HWN bool gSetting_200TX; bool gSetting_500TX; +#endif bool gSetting_350EN; uint8_t gSetting_F_LOCK; bool gSetting_ScrambleEnable; diff --git a/misc.h b/misc.h index 2377fc1..a4d25b0 100644 --- a/misc.h +++ b/misc.h @@ -140,12 +140,19 @@ extern const uint16_t scan_pause_delay_in_7_10ms; extern const uint8_t gMicGain_dB2[5]; +#ifndef ENABLE_FEAT_F4HWN extern bool gSetting_350TX; +#endif + #ifdef ENABLE_DTMF_CALLING extern bool gSetting_KILLED; #endif + +#ifndef ENABLE_FEAT_F4HWN extern bool gSetting_200TX; extern bool gSetting_500TX; +#endif + extern bool gSetting_350EN; extern uint8_t gSetting_F_LOCK; extern bool gSetting_ScrambleEnable; diff --git a/settings.c b/settings.c index cd5d0b9..2f83125 100644 --- a/settings.c +++ b/settings.c @@ -259,14 +259,17 @@ void SETTINGS_InitEEPROM(void) // 0F40..0F47 EEPROM_ReadBuffer(0x0F40, Data, 8); gSetting_F_LOCK = (Data[0] < F_LOCK_LEN) ? Data[0] : F_LOCK_DEF; +#ifndef ENABLE_FEAT_F4HWN gSetting_350TX = (Data[1] < 2) ? Data[1] : false; // was true +#endif #ifdef ENABLE_DTMF_CALLING gSetting_KILLED = (Data[2] < 2) ? Data[2] : false; #endif +#ifndef ENABLE_FEAT_F4HWN gSetting_200TX = (Data[3] < 2) ? Data[3] : false; gSetting_500TX = (Data[4] < 2) ? Data[4] : false; +#endif gSetting_350EN = (Data[5] < 2) ? Data[5] : true; - #ifdef ENABLE_FEAT_F4HWN gSetting_ScrambleEnable = false; #else @@ -691,14 +694,17 @@ void SETTINGS_SaveSettings(void) memset(State, 0xFF, sizeof(State)); State[0] = gSetting_F_LOCK; +#ifndef ENABLE_FEAT_F4HWN State[1] = gSetting_350TX; +#endif #ifdef ENABLE_DTMF_CALLING State[2] = gSetting_KILLED; #endif +#ifndef ENABLE_FEAT_F4HWN State[3] = gSetting_200TX; State[4] = gSetting_500TX; +#endif State[5] = gSetting_350EN; - #ifdef ENABLE_FEAT_F4HWN State[6] = false; #else diff --git a/ui/menu.c b/ui/menu.c index 8fad146..eefcbd4 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -154,9 +154,11 @@ const t_menu_item MenuList[] = // hidden menu items from here on // enabled if pressing both the PTT and upper side button at power-on {"F Lock", MENU_F_LOCK }, +#ifndef ENABLE_FEAT_F4HWN {"Tx 200", MENU_200TX }, // was "200TX" {"Tx 350", MENU_350TX }, // was "350TX" {"Tx 500", MENU_500TX }, // was "500TX" +#endif {"350 En", MENU_350EN }, // was "350EN" #ifndef ENABLE_FEAT_F4HWN {"ScraEn", MENU_SCREN }, // was "SCREN" @@ -735,9 +737,11 @@ void UI_DisplayMenu(void) #ifdef ENABLE_NOAA case MENU_NOAA_S: #endif +#ifndef ENABLE_FEAT_F4HWN case MENU_350TX: case MENU_200TX: case MENU_500TX: +#endif case MENU_350EN: #ifndef ENABLE_FEAT_F4HWN case MENU_SCREN: diff --git a/ui/menu.h b/ui/menu.h index d4f1d28..22163d1 100644 --- a/ui/menu.h +++ b/ui/menu.h @@ -115,9 +115,11 @@ enum #endif MENU_RESET, MENU_F_LOCK, +#ifndef ENABLE_FEAT_F4HWN MENU_200TX, MENU_350TX, MENU_500TX, +#endif MENU_350EN, #ifndef ENABLE_FEAT_F4HWN MENU_SCREN,