Add scan mode menu

This commit is contained in:
Armel FAUVEAU committed 2026-05-04 04:56:15 +02:00
1 parent 932d6e954a
commit c1d5b7bd55
8 files changed
+78 -5

No files matched your search

+17 -2
View File
@@ -63,6 +63,13 @@ static void NextMemChannel(void);
static void ScanFastResetState(void);
#endif
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
static bool ScanFastEnabled(void)
{
return gSetting_set_scn;
}
#endif
#ifdef ENABLE_SCAN_RANGES
static void ScanRangeSkipClear(void)
{
@@ -273,7 +280,7 @@ static void ScanFastTune(uint32_t frequency)
const VFO_Info_t *CHFRSCANNER_GetScanDisplayVfo(void)
{
if (!scanFastDisplayVfoValid || gScanStateDir == SCAN_OFF || FUNCTION_IsRx())
if (!ScanFastEnabled() || !scanFastDisplayVfoValid || gScanStateDir == SCAN_OFF || FUNCTION_IsRx())
return NULL;
return &scanFastDisplayVfo;
@@ -850,6 +857,8 @@ static void NextFreqChannel(void)
#ifdef ENABLE_SCAN_RANGES
if(gScanRangeStart) {
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
if (ScanFastEnabled())
{
const scan_fast_result_t fastResult = ScanRangeFastPrecheck();
if (fastResult == SCAN_FAST_QUIET_BATCH)
@@ -869,6 +878,12 @@ static void NextFreqChannel(void)
{
scanFastLastFullTuneCandidate = true;
}
}
else
{
scanFastLastFullTuneCandidate = false;
gRxVfo->freq_config_RX.Frequency = ScanRangeNextFrequency();
}
#else
gRxVfo->freq_config_RX.Frequency = ScanRangeNextFrequency();
#endif
@@ -1014,7 +1029,7 @@ static void NextMemChannel(void)
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
SetMemScanProgressChannel(gNextMrChannel);
if (!MemChannelFastPrecheck(gNextMrChannel))
if (ScanFastEnabled() && !MemChannelFastPrecheck(gNextMrChannel))
{
gScanPauseDelayIn_10ms = 1;
gUpdateDisplay = true;
+16
View File
@@ -426,6 +426,12 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
//*pMin = 0;
*pMax = ARRAY_SIZE(gSubMenu_SET_MET) - 1;
break;
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
case MENU_SET_SCN:
//*pMin = 0;
*pMax = ARRAY_SIZE(gSubMenu_SET_SCN) - 1;
break;
#endif
#ifdef ENABLE_FEAT_F4HWN_AUDIO
case MENU_SET_AUD:
//*pMin = 0;
@@ -989,6 +995,11 @@ void MENU_AcceptSetting(void)
case MENU_SET_GUI:
gSetting_set_gui = gSubMenuSelection;
break;
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
case MENU_SET_SCN:
gSetting_set_scn = gSubMenuSelection;
break;
#endif
#ifdef ENABLE_FEAT_F4HWN_AUDIO
case MENU_SET_AUD:
if(gTxVfo->Modulation == MODULATION_AM)
@@ -1453,6 +1464,11 @@ void MENU_ShowCurrentSetting(void)
case MENU_SET_GUI:
gSubMenuSelection = gSetting_set_gui;
break;
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
case MENU_SET_SCN:
gSubMenuSelection = gSetting_set_scn;
break;
#endif
#ifdef ENABLE_FEAT_F4HWN_AUDIO
case MENU_SET_AUD:
if(gTxVfo->Modulation == MODULATION_AM)
+4
View File
@@ -116,6 +116,10 @@ enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
bool gWakeUp = false;
#endif
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
bool gSetting_set_scn = 1;
#endif
#ifdef ENABLE_FEAT_F4HWN
uint8_t gSetting_set_pwr = 1;
bool gSetting_set_ptt = 0;
+4
View File
@@ -176,6 +176,10 @@ extern enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
extern bool gWakeUp;
#endif
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
extern bool gSetting_set_scn;
#endif
#ifdef ENABLE_FEAT_F4HWN
extern uint8_t gSetting_set_pwr;
extern bool gSetting_set_ptt;
+2 -1
View File
@@ -110,7 +110,8 @@ void SysTick_Handler(void)
#define SCAN_FAST_STALL_WATCHDOG_10ms 25 // 250 ms
static uint16_t scanFastStallCounter;
if (gScanStateDir != SCAN_OFF
if (gSetting_set_scn
&& gScanStateDir != SCAN_OFF
&& gScanPauseDelayIn_10ms == 0
&& !gScheduleScanListen
&& !g_SquelchLost
+12 -2
View File
@@ -454,8 +454,12 @@ gEeprom.FreqChannel[1] = IS_FREQ_CHANNEL(Data16[5]) ? Data16[5] : (FREQ_CHANNE
// 1FF0..0x1FF7
// TODO: address TBD
PY25Q16_ReadBuffer(0x00A158, Data, 8);
const uint8_t set_ptt_scn = Data[7] & 0x0F;
gSetting_set_pwr = (((Data[7] & 0xF0) >> 4) < 7) ? ((Data[7] & 0xF0) >> 4) : 0;
gSetting_set_ptt = (((Data[7] & 0x0F)) < 2) ? ((Data[7] & 0x0F)) : 0;
gSetting_set_ptt = (set_ptt_scn < 4) ? (set_ptt_scn & 0x01) : 0;
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
gSetting_set_scn = (set_ptt_scn < 4) ? ((set_ptt_scn & 0x02) == 0) : 1;
#endif
gSetting_set_tot = (((Data[6] & 0xF0) >> 4) < 4) ? ((Data[6] & 0xF0) >> 4) : 0;
gSetting_set_eot = (((Data[6] & 0x0F)) < 4) ? ((Data[6] & 0x0F)) : 0;
@@ -1127,7 +1131,13 @@ void SETTINGS_SaveSettings(void)
State[5] = ((tmp << 4) | (gSetting_set_ctr & 0x0F));
State[6] = ((gSetting_set_tot << 4) | (gSetting_set_eot & 0x0F));
State[7] = ((gSetting_set_pwr << 4) | (gSetting_set_ptt & 0x0F));
uint8_t set_ptt_scn = gSetting_set_ptt & 0x01;
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
if (!gSetting_set_scn)
set_ptt_scn |= 0x02;
#endif
State[7] = ((gSetting_set_pwr << 4) | set_ptt_scn);
gEeprom.KEY_LOCK_PTT = gSetting_set_lck;
+17
View File
@@ -168,6 +168,9 @@ const t_menu_item MenuList[] =
#ifdef ENABLE_NOAA
{"SetNWR", MENU_NOAA_S },
#endif
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
{"SetScn", MENU_SET_SCN },
#endif
#endif
// hidden menu items from here on
// enabled if pressing both the PTT and upper side button at power-on
@@ -414,6 +417,14 @@ const char gSubMenu_SCRAMBLER[][7] =
"CLASSIC"
};
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
const char gSubMenu_SET_SCN[][7] =
{
"NORMAL",
"FAST"
};
#endif
#ifdef ENABLE_FEAT_F4HWN_AUDIO
const char gSubMenu_SET_AUD_FM[][6] =
{
@@ -1350,6 +1361,12 @@ void UI_DisplayMenu(void)
strcpy(String, gSubMenu_SET_MET[gSubMenuSelection]); // Same as SET_MET
break;
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
case MENU_SET_SCN:
strcpy(String, gSubMenu_SET_SCN[gSubMenuSelection]);
break;
#endif
#ifdef ENABLE_FEAT_F4HWN_AUDIO
case MENU_SET_AUD:
if(gTxVfo->Modulation == MODULATION_AM) {
+6
View File
@@ -137,6 +137,9 @@ enum
MENU_SET_MET,
MENU_SET_GUI,
MENU_SET_TMR,
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
MENU_SET_SCN,
#endif
#ifdef ENABLE_FEAT_F4HWN_NARROWER
MENU_SET_NFM,
#endif
@@ -191,6 +194,9 @@ extern const char gSubMenu_D_RSP[4][11];
extern const char gSubMenu_SET_TOT[4][7];
extern const char gSubMenu_SET_LCK[2][9];
extern const char gSubMenu_SET_MET[2][8];
#ifdef ENABLE_FEAT_F4HWN_SCAN_FASTER
extern const char gSubMenu_SET_SCN[2][7];
#endif
#ifdef ENABLE_FEAT_F4HWN_NARROWER
extern const char gSubMenu_SET_NFM[2][9];
#endif