Fix scanning on opposite VFO, ignore scan result on EXIT button, changed status bar while scanning

This commit is contained in:
Krzysiek Egzmont
2023-10-17 02:57:55 +02:00
parent 0c0cbb232c
commit 6172d942be
3 changed files with 26 additions and 12 deletions

View File

@@ -506,6 +506,7 @@ static void MAIN_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
} }
else else
{ {
bScanKeepFrequency = false;
SCANNER_Stop(); SCANNER_Stop();
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE

View File

@@ -45,6 +45,7 @@ bool gScanUseCssResult;
int8_t gScanStateDir; int8_t gScanStateDir;
bool bScanKeepFrequency; bool bScanKeepFrequency;
uint8_t gRestoreMrChannel; uint8_t gRestoreMrChannel;
uint8_t gRestoreCROSS_BAND_RX_TX;
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)
{ {
@@ -426,6 +427,11 @@ void SCANNER_Start(void)
void SCANNER_Stop(void) void SCANNER_Stop(void)
{ {
if(gRestoreCROSS_BAND_RX_TX != CROSS_BAND_OFF) {
gEeprom.CROSS_BAND_RX_TX = gRestoreCROSS_BAND_RX_TX;
gRestoreCROSS_BAND_RX_TX = CROSS_BAND_OFF;
}
gScanStateDir = SCAN_OFF; gScanStateDir = SCAN_OFF;
if (!bScanKeepFrequency) if (!bScanKeepFrequency)
@@ -580,6 +586,11 @@ static void SCANNER_NextMemChannel(void)
void SCANNER_NextChannel(const bool storeBackupSettings, const int8_t scan_direction) void SCANNER_NextChannel(const bool storeBackupSettings, const int8_t scan_direction)
{ {
if (storeBackupSettings) {
gRestoreCROSS_BAND_RX_TX = gEeprom.CROSS_BAND_RX_TX;
gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF;
}
RADIO_SelectVfos(); RADIO_SelectVfos();
gNextMrChannel = gRxVfo->CHANNEL_SAVE; gNextMrChannel = gRxVfo->CHANNEL_SAVE;

View File

@@ -88,7 +88,7 @@ void UI_DisplayStatus(const bool test_display)
// SCAN indicator // SCAN indicator
if (gScanStateDir != SCAN_OFF || gScreenToDisplay == DISPLAY_SCANNER || test_display) if (gScanStateDir != SCAN_OFF || gScreenToDisplay == DISPLAY_SCANNER || test_display)
{ {
if (gNextMrChannel <= MR_CHANNEL_LAST) if (gNextMrChannel <= MR_CHANNEL_LAST && gScreenToDisplay != DISPLAY_SCANNER)
{ // channel mode { // channel mode
if (gEeprom.SCAN_LIST_DEFAULT == 0) if (gEeprom.SCAN_LIST_DEFAULT == 0)
UI_PrintStringSmallBuffer("1", line + x); UI_PrintStringSmallBuffer("1", line + x);
@@ -114,22 +114,24 @@ void UI_DisplayStatus(const bool test_display)
memmove(line + x, BITMAP_VoicePrompt, sizeof(BITMAP_VoicePrompt)); memmove(line + x, BITMAP_VoicePrompt, sizeof(BITMAP_VoicePrompt));
x1 = x + sizeof(BITMAP_VoicePrompt); x1 = x + sizeof(BITMAP_VoicePrompt);
} }
x += sizeof(BITMAP_VoicePrompt) + 2; x += sizeof(BITMAP_VoicePrompt) + 1;
#else #else
// hmmm, what to put in it's place // hmmm, what to put in it's place
#endif #endif
uint8_t dw = (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2; x++;
if(dw == 1 || dw == 3 || test_display) { // DWR - dual watch + respond if(gScreenToDisplay != DISPLAY_SCANNER) {
if(gDualWatchActive || test_display) uint8_t dw = (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2;
memmove(line + x, BITMAP_TDR1, sizeof(BITMAP_TDR1) - (dw==1?0:5)); if(dw == 1 || dw == 3 || test_display) { // DWR - dual watch + respond
else if(gDualWatchActive || test_display)
memmove(line + x + 3, BITMAP_TDR2, sizeof(BITMAP_TDR2)); memmove(line + x, BITMAP_TDR1, sizeof(BITMAP_TDR1) - (dw==1?0:5));
else
memmove(line + x + 3, BITMAP_TDR2, sizeof(BITMAP_TDR2));
}
else if(dw == 2) { // XB - crossband
memmove(line + x, BITMAP_XB, sizeof(BITMAP_XB));
}
} }
else if(dw == 2) { // XB - crossband
memmove(line + x, BITMAP_XB, sizeof(BITMAP_XB));
}
x += sizeof(BITMAP_TDR1) + 2; x += sizeof(BITMAP_TDR1) + 2;
#ifdef ENABLE_VOX #ifdef ENABLE_VOX