0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 06:39:49 +03:00

Live DTMF decoder display tidy up + more counter renames

This commit is contained in:
OneOfEleven
2023-09-17 10:13:55 +01:00
parent 78c62d5489
commit 19fa9718f5
10 changed files with 73 additions and 53 deletions

View File

@ -1685,19 +1685,19 @@ void APP_TimeSlice500ms(void)
}
}
if (gDTMF_DecodeRing && gDTMF_DecodeRingCountdown > 0)
if (gDTMF_DecodeRing && gDTMF_DecodeRingCountdown_500ms > 0)
{
if ((--gDTMF_DecodeRingCountdown % 3) == 0)
if ((--gDTMF_DecodeRingCountdown_500ms % 3) == 0)
AUDIO_PlayBeep(BEEP_440HZ_500MS);
if (gDTMF_DecodeRingCountdown == 0)
if (gDTMF_DecodeRingCountdown_500ms == 0)
gDTMF_DecodeRing = false;
}
}
if (gDTMF_IsTx && gDTMF_TxStopCountdown > 0)
if (gDTMF_IsTx && gDTMF_TxStopCountdown_500ms > 0)
{
if (--gDTMF_TxStopCountdown == 0)
if (--gDTMF_TxStopCountdown_500ms == 0)
{
gDTMF_IsTx = false;
gUpdateDisplay = true;
@ -2165,10 +2165,10 @@ Skip:
RADIO_SetupRegisters(true);
gDTMF_AUTO_RESET_TIME = 0;
gDTMF_CallState = DTMF_CALL_STATE_NONE;
gDTMF_TxStopCountdown = 0;
gDTMF_IsTx = false;
gDTMF_AUTO_RESET_TIME = 0;
gDTMF_CallState = DTMF_CALL_STATE_NONE;
gDTMF_TxStopCountdown_500ms = 0;
gDTMF_IsTx = false;
gVFO_RSSI_Level[0] = 0;
gVFO_RSSI_Level[1] = 0;

View File

@ -50,7 +50,7 @@ char gDTMF_Caller[4];
char gDTMF_Callee[4];
DTMF_State_t gDTMF_State;
bool gDTMF_DecodeRing;
uint8_t gDTMF_DecodeRingCountdown;
uint8_t gDTMF_DecodeRingCountdown_500ms;
uint8_t gDTMFChosenContact;
uint8_t gDTMF_AUTO_RESET_TIME;
uint8_t gDTMF_InputIndex;
@ -59,7 +59,7 @@ DTMF_CallState_t gDTMF_CallState;
DTMF_ReplyState_t gDTMF_ReplyState;
DTMF_CallMode_t gDTMF_CallMode;
bool gDTMF_IsTx;
uint8_t gDTMF_TxStopCountdown;
uint8_t gDTMF_TxStopCountdown_500ms;
bool gDTMF_IsGroupCall;
bool DTMF_ValidateCodes(char *pCode, uint8_t Size)
@ -271,15 +271,15 @@ void DTMF_HandleRequest(void)
switch (gEeprom.DTMF_DECODE_RESPONSE)
{
case 3:
gDTMF_DecodeRing = true;
gDTMF_DecodeRingCountdown = 20;
gDTMF_DecodeRing = true;
gDTMF_DecodeRingCountdown_500ms = DTMF_decode_ring_countdown_500ms;
// Fallthrough
case 2:
gDTMF_ReplyState = DTMF_REPLY_AAAAA;
break;
case 1:
gDTMF_DecodeRing = true;
gDTMF_DecodeRingCountdown = 20;
gDTMF_DecodeRing = true;
gDTMF_DecodeRingCountdown_500ms = DTMF_decode_ring_countdown_500ms;
break;
default:
gDTMF_DecodeRing = false;

View File

@ -72,7 +72,7 @@ extern char gDTMF_Caller[4];
extern char gDTMF_Callee[4];
extern DTMF_State_t gDTMF_State;
extern bool gDTMF_DecodeRing;
extern uint8_t gDTMF_DecodeRingCountdown;
extern uint8_t gDTMF_DecodeRingCountdown_500ms;
extern uint8_t gDTMFChosenContact;
extern uint8_t gDTMF_AUTO_RESET_TIME;
extern uint8_t gDTMF_InputIndex;
@ -81,7 +81,7 @@ extern DTMF_CallState_t gDTMF_CallState;
extern DTMF_ReplyState_t gDTMF_ReplyState;
extern DTMF_CallMode_t gDTMF_CallMode;
extern bool gDTMF_IsTx;
extern uint8_t gDTMF_TxStopCountdown;
extern uint8_t gDTMF_TxStopCountdown_500ms;
bool DTMF_ValidateCodes(char *pCode, uint8_t Size);
bool DTMF_GetContact(const int Index, char *pContact);