Fix manual scan resume from active RX

This commit is contained in:
Armel FAUVEAU committed 2026-05-03 02:07:32 +02:00
1 parent 46cf7d7d57
commit a0aefae01b
4 files changed
+28 -8

No files matched your search

+1 -3
View File
@@ -243,9 +243,7 @@ void ACTION_Scan(bool bRestart)
#endif
// jump to the next channel
CHFRSCANNER_Start(false, gScanStateDir);
gScanPauseDelayIn_10ms = 1;
gScheduleScanListen = false;
CHFRSCANNER_ManualResume(gScanStateDir);
} else {
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
if(gScanRangeStart == 0) // No ScanRange
+24 -1
View File
@@ -349,6 +349,26 @@ void CHFRSCANNER_Start(const bool storeBackupSettings, const int8_t scan_directi
gScanPauseMode = false;
}
void CHFRSCANNER_ManualResume(const int8_t scan_direction)
{
if (FUNCTION_IsRx())
{
// Abort the current reception before a user-forced scan step, otherwise
// HandleReceive() can re-apply the carrier resume delay on the next tick.
gMonitor = false;
gRxReceptionMode = RX_MODE_NONE;
gScanPauseMode = false;
FUNCTION_Init();
FUNCTION_Select(FUNCTION_FOREGROUND);
}
CHFRSCANNER_Start(false, scan_direction);
gScanPauseDelayIn_10ms = 1;
gScheduleScanListen = false;
}
/*
void CHFRSCANNER_ContinueScanning(void)
{
@@ -380,7 +400,10 @@ void CHFRSCANNER_ContinueScanning(void)
gCurrentFunction != FUNCTION_INCOMING &&
!g_SquelchLost)
{
ScanFastResetState();
// A rejected full-tune candidate is just a false RSSI hit. Keep the
// learned floor; resetting here can make the next channel blind when
// it is the real signal, especially while scanning down.
scanFastLastFullTuneCandidate = false;
}
#endif
+2 -1
View File
@@ -18,6 +18,7 @@ extern uint32_t gScanRangeStop;
void CHFRSCANNER_Found(void);
void CHFRSCANNER_Stop(void);
void CHFRSCANNER_Start(const bool storeBackupSettings, const int8_t scan_direction);
void CHFRSCANNER_ManualResume(const int8_t scan_direction);
void CHFRSCANNER_ContinueScanning(void);
#if defined(ENABLE_FEAT_F4HWN_RESUME_STATE) || defined(ENABLE_SCAN_RANGES)
@@ -29,4 +30,4 @@ void CHFRSCANNER_ContinueScanning(void);
extern uint32_t lastFoundFrqOrChanOld;
#endif
#endif
#endif
+1 -3
View File
@@ -1010,9 +1010,7 @@ static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
}
// jump to the next channel
CHFRSCANNER_Start(false, Direction);
gScanPauseDelayIn_10ms = 1;
gScheduleScanListen = false;
CHFRSCANNER_ManualResume(Direction);
gPttWasReleased = true;
}