mirror of
https://github.com/DualTachyon/uv-k5-firmware.git
synced 2024-12-09 09:30:36 +08:00
More DTMF cleanups.
This commit is contained in:
parent
fa7b16c9bb
commit
e0c7f11412
12
app/app.c
12
app/app.c
@ -1169,10 +1169,10 @@ LAB_00004b08:
|
||||
}
|
||||
}
|
||||
|
||||
if (g_200003BD && g_200003C3) {
|
||||
g_200003C3--;
|
||||
if (g_200003C3 == 0) {
|
||||
g_200003BD = 0;
|
||||
if (gDTMF_IsTx && gDTMF_TxStopCountdown) {
|
||||
gDTMF_TxStopCountdown--;
|
||||
if (gDTMF_TxStopCountdown == 0) {
|
||||
gDTMF_IsTx = false;
|
||||
gUpdateDisplay = true;
|
||||
}
|
||||
}
|
||||
@ -1559,8 +1559,8 @@ Skip:
|
||||
RADIO_SetupRegisters(true);
|
||||
gDTMF_AUTO_RESET_TIME = 0;
|
||||
gDTMF_CallState = DTMF_CALL_STATE_NONE;
|
||||
g_200003C3 = 0;
|
||||
g_200003BD = 0;
|
||||
gDTMF_TxStopCountdown = 0;
|
||||
gDTMF_IsTx = false;
|
||||
gVFO_RSSI_Level[0] = 0;
|
||||
gVFO_RSSI_Level[1] = 0;
|
||||
g_20000398 = 0;
|
||||
|
@ -46,6 +46,8 @@ uint8_t gDTMF_RecvTimeout;
|
||||
DTMF_CallState_t gDTMF_CallState;
|
||||
DTMF_ReplyState_t gDTMF_ReplyState;
|
||||
DTMF_CallMode_t gDTMF_CallMode;
|
||||
bool gDTMF_IsTx;
|
||||
uint8_t gDTMF_TxStopCountdown;
|
||||
|
||||
bool DTMF_ValidateCodes(char *pCode, uint8_t Size)
|
||||
{
|
||||
|
@ -72,6 +72,8 @@ extern uint8_t gDTMF_RecvTimeout;
|
||||
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;
|
||||
|
||||
bool DTMF_ValidateCodes(char *pCode, uint8_t Size);
|
||||
bool DTMF_GetContact(uint8_t Index, char *pContact);
|
||||
|
2
misc.c
2
misc.c
@ -105,9 +105,7 @@ uint8_t gFlashLightState;
|
||||
uint8_t g_200003B4;
|
||||
uint16_t g_200003B6;
|
||||
uint16_t g_200003B8;
|
||||
uint8_t g_200003BD;
|
||||
uint8_t g_200003C0;
|
||||
uint8_t g_200003C3;
|
||||
uint16_t g_200003E2;
|
||||
volatile uint16_t gFlashLightBlinkCounter;
|
||||
uint8_t g_200003FD;
|
||||
|
2
misc.h
2
misc.h
@ -139,9 +139,7 @@ extern uint8_t gFlashLightState;
|
||||
extern uint8_t g_200003B4;
|
||||
extern uint16_t g_200003B6;
|
||||
extern uint16_t g_200003B8;
|
||||
extern uint8_t g_200003BD;
|
||||
extern uint8_t g_200003C0;
|
||||
extern uint8_t g_200003C3;
|
||||
extern uint16_t g_200003E2;
|
||||
extern volatile uint16_t gFlashLightBlinkCounter;
|
||||
extern uint8_t g_200003FD;
|
||||
|
6
radio.c
6
radio.c
@ -747,12 +747,12 @@ void RADIO_SomethingWithTransmit(void)
|
||||
Skip:
|
||||
if (gDTMF_ReplyState == DTMF_REPLY_ANI) {
|
||||
if (gDTMF_CallMode == DTMF_CALL_MODE_DTMF) {
|
||||
g_200003BD = 1;
|
||||
gDTMF_IsTx = true;
|
||||
gDTMF_CallState = DTMF_CALL_STATE_NONE;
|
||||
g_200003C3 = 6;
|
||||
gDTMF_TxStopCountdown = 6;
|
||||
} else {
|
||||
gDTMF_CallState = DTMF_CALL_STATE_CALL_OUT;
|
||||
g_200003BD = 0;
|
||||
gDTMF_IsTx = false;
|
||||
}
|
||||
}
|
||||
FUNCTION_Select(FUNCTION_TRANSMIT);
|
||||
|
@ -65,7 +65,7 @@ void UI_DisplayMain(void)
|
||||
}
|
||||
|
||||
if (Channel != i) {
|
||||
if (gDTMF_CallState != DTMF_CALL_STATE_NONE || g_200003BD || gDTMF_InputMode) {
|
||||
if (gDTMF_CallState != DTMF_CALL_STATE_NONE || gDTMF_IsTx || gDTMF_InputMode) {
|
||||
char Contact[16];
|
||||
|
||||
if (!gDTMF_InputMode) {
|
||||
@ -81,7 +81,7 @@ void UI_DisplayMain(void)
|
||||
} else {
|
||||
sprintf(String, "CALL:%s", gDTMF_Caller);
|
||||
}
|
||||
} else if (g_200003BD == 1) {
|
||||
} else if (gDTMF_IsTx) {
|
||||
if (gDTMF_State == DTMF_STATE_TX_SUCC) {
|
||||
strcpy(String, "DTMF TX(SUCC)");
|
||||
} else {
|
||||
@ -109,7 +109,7 @@ void UI_DisplayMain(void)
|
||||
} else {
|
||||
sprintf(String, ">%s", gDTMF_Callee);
|
||||
}
|
||||
} else if (g_200003BD == 1) {
|
||||
} else if (gDTMF_IsTx) {
|
||||
sprintf(String, ">%s", gDTMF_String);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user