FIX #158: Don't allow to enter DTMF input when scan range is active

This commit is contained in:
Krzysiek Egzmont
2023-11-29 17:38:31 +01:00
parent 5ad8229d7c
commit f9e10da9ee

View File

@@ -631,8 +631,6 @@ static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
if (bKeyPressed) // just pressed if (bKeyPressed) // just pressed
{ {
// gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
gBeepToPlay = BEEP_880HZ_40MS_OPTIONAL;
return; return;
} }
@@ -640,14 +638,16 @@ static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
if (!gWasFKeyPressed) // pressed without the F-key if (!gWasFKeyPressed) // pressed without the F-key
{ {
if (gScanStateDir == SCAN_OFF
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
if (gScanStateDir == SCAN_OFF && !IS_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE)) && !IS_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE)
#else
if (gScanStateDir == SCAN_OFF)
#endif #endif
#ifdef ENABLE_SCAN_RANGES
&& gScanRangeStart == 0
#endif
)
{ // start entering a DTMF string { // start entering a DTMF string
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
memmove(gDTMF_InputBox, gDTMF_String, MIN(sizeof(gDTMF_InputBox), sizeof(gDTMF_String) - 1)); memmove(gDTMF_InputBox, gDTMF_String, MIN(sizeof(gDTMF_InputBox), sizeof(gDTMF_String) - 1));
gDTMF_InputBox_Index = 0; gDTMF_InputBox_Index = 0;
gDTMF_InputMode = true; gDTMF_InputMode = true;
@@ -656,6 +656,8 @@ static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
gRequestDisplayScreen = DISPLAY_MAIN; gRequestDisplayScreen = DISPLAY_MAIN;
} }
else
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
} }
else else
{ // with the F-key { // with the F-key
@@ -676,7 +678,6 @@ static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
} }
gPttWasReleased = true; gPttWasReleased = true;
gUpdateStatus = true; gUpdateStatus = true;
} }