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:
12
app/app.c
12
app/app.c
@ -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;
|
||||
@ -2167,7 +2167,7 @@ Skip:
|
||||
|
||||
gDTMF_AUTO_RESET_TIME = 0;
|
||||
gDTMF_CallState = DTMF_CALL_STATE_NONE;
|
||||
gDTMF_TxStopCountdown = 0;
|
||||
gDTMF_TxStopCountdown_500ms = 0;
|
||||
gDTMF_IsTx = false;
|
||||
|
||||
gVFO_RSSI_Level[0] = 0;
|
||||
|
@ -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)
|
||||
@ -272,14 +272,14 @@ void DTMF_HandleRequest(void)
|
||||
{
|
||||
case 3:
|
||||
gDTMF_DecodeRing = true;
|
||||
gDTMF_DecodeRingCountdown = 20;
|
||||
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_DecodeRingCountdown_500ms = DTMF_decode_ring_countdown_500ms;
|
||||
break;
|
||||
default:
|
||||
gDTMF_DecodeRing = false;
|
||||
|
@ -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);
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
2
misc.c
2
misc.c
@ -27,6 +27,8 @@ const uint8_t menu_timeout_500ms = 20000 / 500; // 20 seconds
|
||||
|
||||
const uint8_t DTMF_RX_timeout_500ms = 2500 / 500; // 2.5 seconds
|
||||
const uint8_t DTMF_RX_timeout_saved_500ms = 20000 / 500; // 20 seconds
|
||||
const uint8_t DTMF_decode_ring_countdown_500ms = 15000 / 500; // 15 seconds
|
||||
const uint8_t DTMF_txstop_countdown_500ms = 3000 / 500; // 6 seconds
|
||||
|
||||
const uint8_t key_input_timeout_500ms = 8000 / 500; // 8 seconds
|
||||
|
||||
|
2
misc.h
2
misc.h
@ -87,6 +87,8 @@ extern const uint8_t menu_timeout_500ms;
|
||||
|
||||
extern const uint8_t DTMF_RX_timeout_500ms;
|
||||
extern const uint8_t DTMF_RX_timeout_saved_500ms;
|
||||
extern const uint8_t DTMF_decode_ring_countdown_500ms;
|
||||
extern const uint8_t DTMF_txstop_countdown_500ms;
|
||||
|
||||
extern const uint8_t key_input_timeout_500ms;
|
||||
|
||||
|
2
radio.c
2
radio.c
@ -915,7 +915,7 @@ Skip:
|
||||
{
|
||||
gDTMF_IsTx = true;
|
||||
gDTMF_CallState = DTMF_CALL_STATE_NONE;
|
||||
gDTMF_TxStopCountdown = 6;
|
||||
gDTMF_TxStopCountdown_500ms = DTMF_txstop_countdown_500ms;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
16
ui/main.c
16
ui/main.c
@ -98,7 +98,13 @@ void UI_DisplayMain(void)
|
||||
strcpy(String, (gDTMF_State == DTMF_STATE_TX_SUCC) ? "DTMF TX(SUCC)" : "DTMF TX");
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(String, ">%s", gDTMF_InputBox);
|
||||
|
||||
#ifdef ENABLE_DTMF_DECODER
|
||||
show_dtmf_rx = false;
|
||||
#endif
|
||||
}
|
||||
UI_PrintString(String, 2, 0, vfo_num * 3, 8);
|
||||
|
||||
memset(String, 0, sizeof(String));
|
||||
@ -114,6 +120,12 @@ void UI_DisplayMain(void)
|
||||
if (gDTMF_IsTx)
|
||||
sprintf(String, ">%s", gDTMF_String);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef ENABLE_DTMF_DECODER
|
||||
show_dtmf_rx = false;
|
||||
#endif
|
||||
}
|
||||
UI_PrintString(String, 2, 0, 2 + (vfo_num * 3), 8);
|
||||
|
||||
#ifdef ENABLE_DTMF_DECODER
|
||||
@ -225,6 +237,10 @@ void UI_DisplayMain(void)
|
||||
if (gInputBoxIndex > 0 && IS_FREQ_CHANNEL(gEeprom.ScreenChannel[vfo_num]) && gEeprom.TX_CHANNEL == vfo_num)
|
||||
{ // user entering a frequency
|
||||
UI_DisplayFrequency(gInputBox, 31, Line, true, false);
|
||||
|
||||
#ifdef ENABLE_DTMF_DECODER
|
||||
show_dtmf_rx = false;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user