Add exclude memory channel

This commit is contained in:
Armel FAUVEAU
2024-03-26 00:34:04 +01:00
parent 8ec757dbfe
commit 25ced9401e
7 changed files with 55 additions and 13 deletions

View File

@@ -25,7 +25,13 @@ typedef enum {
scan_next_chan_t currentScanList;
uint32_t initialFrqOrChan;
uint8_t initialCROSS_BAND_RX_TX;
uint32_t lastFoundFrqOrChan;
#ifndef ENABLE_FEAT_F4HWN
uint32_t lastFoundFrqOrChan;
#else
uint32_t lastFoundFrqOrChan;
uint32_t lastFoundFrqOrChanOld;
#endif
static void NextFreqChannel(void);
static void NextMemChannel(void);
@@ -61,6 +67,10 @@ void CHFRSCANNER_Start(const bool storeBackupSettings, const int8_t scan_directi
NextFreqChannel();
}
#ifdef ENABLE_FEAT_F4HWN
lastFoundFrqOrChanOld = lastFoundFrqOrChan;
#endif
gScanPauseDelayIn_10ms = scan_pause_delay_in_2_10ms;
gScheduleScanListen = false;
gRxReceptionMode = RX_MODE_NONE;
@@ -109,6 +119,10 @@ void CHFRSCANNER_Found(void)
break;
}
#ifdef ENABLE_FEAT_F4HWN
lastFoundFrqOrChanOld = lastFoundFrqOrChan;
#endif
if (IS_MR_CHANNEL(gRxVfo->CHANNEL_SAVE)) { //memory scan
lastFoundFrqOrChan = gRxVfo->CHANNEL_SAVE;
}

View File

@@ -20,4 +20,9 @@ void CHFRSCANNER_Stop(void);
void CHFRSCANNER_Start(const bool storeBackupSettings, const int8_t scan_direction);
void CHFRSCANNER_ContinueScanning(void);
#ifdef ENABLE_FEAT_F4HWN
extern uint32_t lastFoundFrqOrChan;
extern uint32_t lastFoundFrqOrChanOld;
#endif
#endif

View File

@@ -540,6 +540,30 @@ static void MAIN_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
if (bKeyHeld) { // menu key held down (long press)
#ifdef ENABLE_FEAT_F4HWN
if(gScanStateDir != SCAN_OFF)
{
gTxVfo->SCANLIST1_PARTICIPATION = 0;
gTxVfo->SCANLIST2_PARTICIPATION = 0;
gWriteChannel = false;
SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true);
gWriteChannel = true;
gVfoConfigureMode = VFO_CONFIGURE;
gFlagResetVfos = true;
//gDebug = (uint8_t)lastFoundFrqOrChanOld;
lastFoundFrqOrChan = lastFoundFrqOrChanOld;
CHFRSCANNER_ContinueScanning();
return;
}
#endif
if (bKeyPressed) { // long press MENU key
gWasFKeyPressed = false;

View File

@@ -41,7 +41,6 @@ bool gScanUseCssResult;
STEP_Setting_t stepSetting;
uint8_t scanHitCount;
static void SCANNER_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{
if (!bKeyHeld && bKeyPressed)
@@ -259,16 +258,7 @@ static void SCANNER_Key_UP_DOWN(bool bKeyPressed, bool pKeyHeld, int8_t Directio
void SCANNER_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{
switch (Key) {
case KEY_0:
case KEY_1:
case KEY_2:
case KEY_3:
case KEY_4:
case KEY_5:
case KEY_6:
case KEY_7:
case KEY_8:
case KEY_9:
case KEY_0...KEY_9:
SCANNER_Key_DIGITS(Key, bKeyPressed, bKeyHeld);
break;
case KEY_MENU: