Refactor
This commit is contained in:
15
app/main.c
15
app/main.c
@@ -459,9 +459,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
|||||||
|
|
||||||
static void MAIN_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
|
static void MAIN_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
|
||||||
{
|
{
|
||||||
if (!bKeyHeld && bKeyPressed)
|
if (!bKeyHeld && bKeyPressed) { // exit key pressed
|
||||||
{ // exit key pressed
|
|
||||||
|
|
||||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||||
|
|
||||||
#ifdef ENABLE_DTMF_CALLING
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
@@ -477,8 +475,7 @@ static void MAIN_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
|
|||||||
if (!gFmRadioMode)
|
if (!gFmRadioMode)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (gScanStateDir == SCAN_OFF)
|
if (gScanStateDir == SCAN_OFF) {
|
||||||
{
|
|
||||||
if (gInputBoxIndex == 0)
|
if (gInputBoxIndex == 0)
|
||||||
return;
|
return;
|
||||||
gInputBox[--gInputBoxIndex] = 10;
|
gInputBox[--gInputBoxIndex] = 10;
|
||||||
@@ -490,8 +487,7 @@ static void MAIN_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
|
|||||||
gAnotherVoiceID = VOICE_ID_CANCEL;
|
gAnotherVoiceID = VOICE_ID_CANCEL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
gScanKeepResult = false;
|
gScanKeepResult = false;
|
||||||
CHFRSCANNER_Stop();
|
CHFRSCANNER_Stop();
|
||||||
|
|
||||||
@@ -507,13 +503,10 @@ static void MAIN_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
|
|||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
ACTION_FM();
|
ACTION_FM();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bKeyHeld && bKeyPressed)
|
if (bKeyHeld && bKeyPressed) { // exit key held down
|
||||||
{ // exit key held down
|
|
||||||
|
|
||||||
if (gInputBoxIndex > 0 || gDTMF_InputBox_Index > 0 || gDTMF_InputMode)
|
if (gInputBoxIndex > 0 || gDTMF_InputBox_Index > 0 || gDTMF_InputMode)
|
||||||
{ // cancel key input mode (channel/frequency entry)
|
{ // cancel key input mode (channel/frequency entry)
|
||||||
gDTMF_InputMode = false;
|
gDTMF_InputMode = false;
|
||||||
|
@@ -233,15 +233,13 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
|
|||||||
|
|
||||||
gCurrentFunction = Function;
|
gCurrentFunction = Function;
|
||||||
|
|
||||||
if (bWasPowerSave && Function != FUNCTION_POWER_SAVE)
|
if (bWasPowerSave && Function != FUNCTION_POWER_SAVE) {
|
||||||
{
|
|
||||||
BK4819_Conditional_RX_TurnOn_and_GPIO6_Enable();
|
BK4819_Conditional_RX_TurnOn_and_GPIO6_Enable();
|
||||||
gRxIdleMode = false;
|
gRxIdleMode = false;
|
||||||
UI_DisplayStatus();
|
UI_DisplayStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (Function)
|
switch (Function) {
|
||||||
{
|
|
||||||
case FUNCTION_FOREGROUND:
|
case FUNCTION_FOREGROUND:
|
||||||
FUNCTION_Foreground(PreviousFunction);
|
FUNCTION_Foreground(PreviousFunction);
|
||||||
return;
|
return;
|
||||||
|
3
misc.h
3
misc.h
@@ -207,9 +207,6 @@ extern volatile bool gTxTimeoutReached;
|
|||||||
|
|
||||||
extern volatile uint16_t gTailNoteEliminationCountdown_10ms;
|
extern volatile uint16_t gTailNoteEliminationCountdown_10ms;
|
||||||
|
|
||||||
#ifdef ENABLE_FMRADIO
|
|
||||||
extern volatile uint16_t gFmPlayCountdown_10ms;
|
|
||||||
#endif
|
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
extern volatile uint16_t gNOAA_Countdown_10ms;
|
extern volatile uint16_t gNOAA_Countdown_10ms;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -53,8 +53,7 @@ void SystickHandler(void)
|
|||||||
|
|
||||||
gNextTimeslice = true;
|
gNextTimeslice = true;
|
||||||
|
|
||||||
if ((gGlobalSysTickCounter % 50) == 0)
|
if ((gGlobalSysTickCounter % 50) == 0) {
|
||||||
{
|
|
||||||
gNextTimeslice_500ms = true;
|
gNextTimeslice_500ms = true;
|
||||||
|
|
||||||
DECREMENT_AND_TRIGGER(gTxTimerCountdown_500ms, gTxTimeoutReached);
|
DECREMENT_AND_TRIGGER(gTxTimerCountdown_500ms, gTxTimeoutReached);
|
||||||
|
Reference in New Issue
Block a user