Hold scan resume during scan list name (memory scan only)

This commit is contained in:
Armel FAUVEAU committed 2026-08-09 23:44:40 +02:00
1 parent abc146a1b6
commit 528678a31b
3 files changed
+21 -2

No files matched your search

+4 -2
View File
@@ -1245,9 +1245,11 @@ void APP_Update(void)
#endif
#ifdef ENABLE_VOICE
if (!SCANNER_IsScanning() && gScanStateDir != SCAN_OFF && gScheduleScanListen && !gPttIsPressed && gVoiceWriteIndex == 0)
if (!SCANNER_IsScanning() && gScanStateDir != SCAN_OFF && gScheduleScanListen && !gPttIsPressed && gVoiceWriteIndex == 0
&& !UI_MAIN_ShouldHoldScanResume())
#else
if (!SCANNER_IsScanning() && gScanStateDir != SCAN_OFF && gScheduleScanListen && !gPttIsPressed)
if (!SCANNER_IsScanning() && gScanStateDir != SCAN_OFF && gScheduleScanListen && !gPttIsPressed
&& !UI_MAIN_ShouldHoldScanResume())
#endif
{ // scanning
CHFRSCANNER_ContinueScanning();
+14
View File
@@ -240,6 +240,20 @@ void UI_MAIN_NotifyScanListChanged(void)
gUpdateDisplay = true;
}
// True while the "SCAN LIST xxx" name actually occupies the screen. Used to
// freeze the scan so it does not race ahead of the (hidden) progress gauge,
// which would make the bar snap forward when it reappears.
//
// The IS_MR_CHANNEL() test mirrors show_memory in UI_DrawScanProgress(): the
// name is only ever drawn during a memory (channel) scan. A frequency/range
// scan can still arm the countdown (F + UP/DOWN cycles lists on any scan), but
// no name is shown there, so it must NOT be held - otherwise the scanner would
// stall ~2 s with nothing on screen to explain the pause.
bool UI_MAIN_ShouldHoldScanResume(void)
{
return gScanListNameCountdown_500ms > 0 && IS_MR_CHANNEL(gNextMrChannel);
}
static inline void ScanProgress_SetBit(uint8_t *map, uint16_t ch)
{
map[ch >> 3] |= (uint8_t)(1u << (ch & 7));
+3
View File
@@ -18,6 +18,7 @@
#define UI_MAIN_H
#include <stdint.h>
#include <stdbool.h>
enum center_line_t {
CENTER_LINE_NONE = 0,
@@ -56,9 +57,11 @@ void UI_DisplayMain(void);
#ifdef ENABLE_FEAT_F4HWN_SCAN_PROGRESS
void UI_MAIN_NotifyScanProgressDataChanged(void);
void UI_MAIN_NotifyScanListChanged(void);
bool UI_MAIN_ShouldHoldScanResume(void);
#else
static inline void UI_MAIN_NotifyScanProgressDataChanged(void) {}
static inline void UI_MAIN_NotifyScanListChanged(void) {}
static inline bool UI_MAIN_ShouldHoldScanResume(void) { return false; }
#endif
#ifdef ENABLE_AGC_SHOW_DATA