Skip to content

Commit

Permalink
Fix issue #173
Browse files Browse the repository at this point in the history
  • Loading branch information
armel committed Jul 8, 2024
1 parent 9a4d439 commit e7c784d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
20 changes: 0 additions & 20 deletions app/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -1473,26 +1473,6 @@ void APP_TimeSlice500ms(void)
}

cancelUserInputModes();

if (gBeepToPlay != BEEP_NONE)
{
AUDIO_PlayBeep(gBeepToPlay);
gBeepToPlay = BEEP_NONE;
}
}
else
{
if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE)) { // user is entering channel number
switch (gInputBoxIndex)
{
case 1:
channelMove(gInputBox[0] - 1, false);
break;
case 2:
channelMove(((gInputBox[0] * 10) + gInputBox[1]) - 1, false);
break;
}
}
}
}

Expand Down
40 changes: 30 additions & 10 deletions app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,29 @@ void channelMove(uint16_t Channel, bool End)
return;
}

void channelMoveSwitch(void) {
if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE)) { // user is entering channel number
switch (gInputBoxIndex)
{
case 1:
if (gInputBox[0] != 0) {
channelMove(gInputBox[0] - 1, false);
}

break;
case 2:
if (!((gInputBox[0] == 0) && (gInputBox[1] == 0))) {
channelMove(((gInputBox[0] * 10) + gInputBox[1]) - 1, false);
}

break;
case 3:
channelMove(((gInputBox[0] * 100) + (gInputBox[1] * 10) + gInputBox[2]) - 1, true);
break;
}
}
}

static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{
if (bKeyHeld) { // key held down
Expand Down Expand Up @@ -402,23 +425,20 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
}

const uint8_t Vfo = gEeprom.TX_VFO;
gKeyInputCountdown = key_input_timeout_500ms;
INPUTBOX_Append(Key);
gKeyInputCountdown = key_input_timeout_500ms;
gRequestDisplayScreen = DISPLAY_MAIN;

if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE)) { // user is entering channel number
channelMoveSwitch();

gKeyInputCountdown = (key_input_timeout_500ms / 5); // short time...

if (gInputBoxIndex != 3) {
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
gRequestDisplayScreen = DISPLAY_MAIN;
return;
}

channelMove(((gInputBox[0] * 100) + (gInputBox[1] * 10) + gInputBox[2]) - 1, true);
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif

return;
}

// #ifdef ENABLE_NOAA
Expand Down

0 comments on commit e7c784d

Please sign in to comment.