Skip to content

Commit

Permalink
FIX #158: Don't allow to enter DTMF input when scan range is active
Browse files Browse the repository at this point in the history
  • Loading branch information
egzumer committed Nov 29, 2023
1 parent 5ad8229 commit f9e10da
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,23 +631,23 @@ static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)

if (bKeyPressed) // just pressed
{
// gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
gBeepToPlay = BEEP_880HZ_40MS_OPTIONAL;
return;
}

// just released

if (!gWasFKeyPressed) // pressed without the F-key
{

#ifdef ENABLE_NOAA
if (gScanStateDir == SCAN_OFF && !IS_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE))
#else
if (gScanStateDir == SCAN_OFF)
#endif
if (gScanStateDir == SCAN_OFF
#ifdef ENABLE_NOAA
&& !IS_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE)
#endif
#ifdef ENABLE_SCAN_RANGES
&& gScanRangeStart == 0
#endif
)
{ // start entering a DTMF string

gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
memmove(gDTMF_InputBox, gDTMF_String, MIN(sizeof(gDTMF_InputBox), sizeof(gDTMF_String) - 1));
gDTMF_InputBox_Index = 0;
gDTMF_InputMode = true;
Expand All @@ -656,6 +656,8 @@ static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)

gRequestDisplayScreen = DISPLAY_MAIN;
}
else
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
}
else
{ // with the F-key
Expand All @@ -676,7 +678,6 @@ static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
}

gPttWasReleased = true;

gUpdateStatus = true;
}

Expand Down

0 comments on commit f9e10da

Please sign in to comment.