Add "switch demodulation mode" function for programmable buttons

This commit is contained in:
Krzysiek Egzmont 2023-11-02 18:11:13 +01:00
parent 388c3dadf1
commit 8c9bdaacbc
4 changed files with 15 additions and 1 deletions

View File

@ -324,6 +324,14 @@ void ACTION_Scan(bool bRestart)
}
#endif
void ACTION_SwitchDemodul(void)
{
gTxVfo->Modulation++;
if(gTxVfo->Modulation == MODULATION_UKNOWN)
gTxVfo->Modulation = MODULATION_FM;
gRequestSaveChannel = 1;
}
void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{
if (gScreenToDisplay == DISPLAY_MAIN && gDTMF_InputMode) // entering DTMF code
@ -439,5 +447,8 @@ void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
case ACTION_OPT_VFO_MR:
COMMON_SwitchVFOMode();
break;
case ACTION_OPT_SWITCH_DEMODUL:
ACTION_SwitchDemodul();
break;
}
}

View File

@ -32,6 +32,7 @@ void ACTION_Scan(bool bRestart);
#ifdef ENABLE_FMRADIO
void ACTION_FM(void);
#endif
void ACTION_SwitchDemodul(void);
void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);

View File

@ -84,6 +84,7 @@ enum {
ACTION_OPT_KEYLOCK,
ACTION_OPT_A_B,
ACTION_OPT_VFO_MR,
ACTION_OPT_SWITCH_DEMODUL,
ACTION_OPT_LEN
};

View File

@ -360,6 +360,7 @@ const t_sidefunction SIDEFUNCTIONS[] =
{"LOCK\nKEYPAD", ACTION_OPT_KEYLOCK},
{"SWITCH\nVFO", ACTION_OPT_A_B},
{"VFO/MR", ACTION_OPT_VFO_MR},
{"SWITCH\nDEMODUL", ACTION_OPT_SWITCH_DEMODUL},
};
const t_sidefunction* gSubMenu_SIDEFUNCTIONS = SIDEFUNCTIONS;
const uint8_t gSubMenu_SIDEFUNCTIONS_size = ARRAY_SIZE(SIDEFUNCTIONS);