Use function to check if in RX mode

This commit is contained in:
Juan Antonio
2023-12-07 12:12:19 +01:00
parent c3906f42f8
commit 2164461449
7 changed files with 23 additions and 45 deletions

View File

@@ -42,6 +42,14 @@
FUNCTION_Type_t gCurrentFunction;
inline bool FUNCTION_IsRx()
{
return gCurrentFunction == FUNCTION_MONITOR ||
gCurrentFunction == FUNCTION_INCOMING ||
gCurrentFunction == FUNCTION_RECEIVE;
}
void FUNCTION_Init(void)
{
#ifdef ENABLE_NOAA
@@ -119,7 +127,7 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
if (gFmRadioMode)
gFM_RestoreCountdown_10ms = fm_restore_countdown_10ms;
#endif
#ifdef ENABLE_DTMF_CALLING
if (gDTMF_CallState == DTMF_CALL_STATE_CALL_OUT ||
gDTMF_CallState == DTMF_CALL_STATE_RECEIVED ||
@@ -147,7 +155,7 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
gMonitor = false;
BK4819_DisableVox();
BK4819_DisableVox();
BK4819_Sleep();
BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28_RX_ENABLE, false);