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

View File

@@ -540,6 +540,30 @@ static void MAIN_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL; gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
if (bKeyHeld) { // menu key held down (long press) 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 if (bKeyPressed) { // long press MENU key
gWasFKeyPressed = false; gWasFKeyPressed = false;

View File

@@ -41,7 +41,6 @@ bool gScanUseCssResult;
STEP_Setting_t stepSetting; STEP_Setting_t stepSetting;
uint8_t scanHitCount; uint8_t scanHitCount;
static void SCANNER_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) static void SCANNER_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{ {
if (!bKeyHeld && bKeyPressed) 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) void SCANNER_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{ {
switch (Key) { switch (Key) {
case KEY_0: case KEY_0...KEY_9:
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:
SCANNER_Key_DIGITS(Key, bKeyPressed, bKeyHeld); SCANNER_Key_DIGITS(Key, bKeyPressed, bKeyHeld);
break; break;
case KEY_MENU: case KEY_MENU:

1
misc.c
View File

@@ -116,6 +116,7 @@ enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
bool gSetting_set_gui = 0; bool gSetting_set_gui = 0;
bool gSetting_set_ptt_session; bool gSetting_set_ptt_session;
uint8_t gDebug; uint8_t gDebug;
bool gWriteChannel = true;
#endif #endif
#ifdef ENABLE_AUDIO_BAR #ifdef ENABLE_AUDIO_BAR

2
misc.h
View File

@@ -350,7 +350,7 @@ extern volatile uint8_t boot_counter_10ms;
extern uint8_t gPttOnePushCounter; extern uint8_t gPttOnePushCounter;
extern uint32_t gBlinkCounter; extern uint32_t gBlinkCounter;
extern uint8_t gDebug; extern uint8_t gDebug;
extern bool gWriteChannel;
#endif #endif
int32_t NUMBER_AddWithWraparound(int32_t Base, int32_t Add, int32_t LowerLimit, int32_t UpperLimit); int32_t NUMBER_AddWithWraparound(int32_t Base, int32_t Add, int32_t LowerLimit, int32_t UpperLimit);

View File

@@ -776,7 +776,15 @@ void SETTINGS_UpdateChannel(uint8_t channel, const VFO_Info_t *pVFO, bool keep)
} }
state[channel & 7u] = att.__val; state[channel & 7u] = att.__val;
#ifdef ENABLE_FEAT_F4HWN
if(gWriteChannel)
{
EEPROM_WriteBuffer(offset, state); EEPROM_WriteBuffer(offset, state);
}
#else
EEPROM_WriteBuffer(offset, state);
#endif
gMR_ChannelAttributes[channel] = att; gMR_ChannelAttributes[channel] = att;