diff --git a/app/dtmf.c b/app/dtmf.c index e08fbf2..14dcb00 100644 --- a/app/dtmf.c +++ b/app/dtmf.c @@ -50,6 +50,7 @@ DTMF_ReplyState_t gDTMF_ReplyState; DTMF_CallMode_t gDTMF_CallMode; bool gDTMF_IsTx; uint8_t gDTMF_TxStopCountdown; +bool gDTMF_IsGroupCall; bool DTMF_ValidateCodes(char *pCode, uint8_t Size) { @@ -130,28 +131,28 @@ char DTMF_GetCharacter(uint8_t Code) return 0xFF; } -bool DTMF_CompareMessage(const char *pDTMF, const char *pTemplate, uint8_t Size, bool bFlag) +bool DTMF_CompareMessage(const char *pMsg, const char *pTemplate, uint8_t Size, bool bCheckGroup) { uint8_t i; for (i = 0; i < Size; i++) { - if (pDTMF[i] != pTemplate[i]) { - if (!bFlag || pDTMF[i] != gEeprom.DTMF_GROUP_CALL_CODE) { + if (pMsg[i] != pTemplate[i]) { + if (!bCheckGroup || pMsg[i] != gEeprom.DTMF_GROUP_CALL_CODE) { return false; } - g_20000439 = true; + gDTMF_IsGroupCall = true; } } return true; } -bool DTMF_IsGroupCall(const char *pDTMF, uint32_t Size) +bool DTMF_CheckGroupCall(const char *pMsg, uint32_t Size) { uint32_t i; for (i = 0; i < Size; i++) { - if (pDTMF[i] == gEeprom.DTMF_GROUP_CALL_CODE) { + if (pMsg[i] == gEeprom.DTMF_GROUP_CALL_CODE) { break; } } @@ -248,7 +249,7 @@ void DTMF_HandleRequest(void) if (gDTMF_WriteIndex >= 7) { Offset = gDTMF_WriteIndex - 7; sprintf(String, "%s%c", gEeprom.ANI_DTMF_ID, gEeprom.DTMF_SEPARATE_CODE); - g_20000439 = false; + gDTMF_IsGroupCall = false; if (DTMF_CompareMessage(gDTMF_Received + Offset, String, 4, true)) { gDTMF_CallState = DTMF_CALL_STATE_RECEIVED; memcpy(gDTMF_Callee, gDTMF_Received + Offset, 3); @@ -274,7 +275,7 @@ void DTMF_HandleRequest(void) break; } - if (g_20000439) { + if (gDTMF_IsGroupCall) { gDTMF_ReplyState = DTMF_REPLY_NONE; } } diff --git a/app/dtmf.h b/app/dtmf.h index 7101f76..2227e7b 100644 --- a/app/dtmf.h +++ b/app/dtmf.h @@ -81,7 +81,7 @@ bool DTMF_GetContact(uint8_t Index, char *pContact); bool DTMF_FindContact(const char *pContact, char *pResult); char DTMF_GetCharacter(uint8_t Code); bool DTMF_CompareMessage(const char *pDTMF, const char *pTemplate, uint8_t Size, bool bFlag); -bool DTMF_IsGroupCall(const char *pDTMF, uint32_t Size); +bool DTMF_CheckGroupCall(const char *pDTMF, uint32_t Size); void DTMF_Append(char Code); void DTMF_HandleRequest(void); void DTMF_Reply(void); diff --git a/app/generic.c b/app/generic.c index e408ade..ef6844f 100644 --- a/app/generic.c +++ b/app/generic.c @@ -132,7 +132,7 @@ void GENERIC_Key_PTT(bool bKeyPressed) } gDTMF_InputBox[gDTMF_InputIndex] = 0; if (gDTMF_InputIndex == 3) { - gDTMF_CallMode = DTMF_IsGroupCall(gDTMF_InputBox, 3); + gDTMF_CallMode = DTMF_CheckGroupCall(gDTMF_InputBox, 3); } else { gDTMF_CallMode = DTMF_CALL_MODE_DTMF; } diff --git a/misc.c b/misc.c index 190b65e..a736165 100644 --- a/misc.c +++ b/misc.c @@ -117,7 +117,6 @@ uint16_t gAlarmRunningCounter; bool gKeyBeingHeld; bool gPttIsPressed; uint8_t gPttDebounceCounter; -bool g_20000439; uint8_t gMenuListCount; uint8_t gBackupCROSS_BAND_RX_TX; uint8_t g_2000045D; diff --git a/misc.h b/misc.h index 6bcf4d9..1ab6be9 100644 --- a/misc.h +++ b/misc.h @@ -168,7 +168,6 @@ extern uint16_t gAlarmRunningCounter; extern bool gKeyBeingHeld; extern bool gPttIsPressed; extern uint8_t gPttDebounceCounter; -extern bool g_20000439; extern uint8_t gMenuListCount; extern uint8_t gBackupCROSS_BAND_RX_TX; extern uint8_t g_2000045D;