diff --git a/app/app.c b/app/app.c index fb1eb59..1c4c53f 100644 --- a/app/app.c +++ b/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; @@ -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; diff --git a/app/dtmf.c b/app/dtmf.c index 126552c..12968a6 100644 --- a/app/dtmf.c +++ b/app/dtmf.c @@ -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; diff --git a/app/dtmf.h b/app/dtmf.h index 8d5d0d0..63bfad8 100644 --- a/app/dtmf.h +++ b/app/dtmf.h @@ -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); diff --git a/firmware b/firmware index c5fb271..fea5950 100644 Binary files a/firmware and b/firmware differ diff --git a/firmware.bin b/firmware.bin index 7f427a8..aee8da5 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index cc72b90..bad1731 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/misc.c b/misc.c index d9d6f27..8d07fab 100644 --- a/misc.c +++ b/misc.c @@ -18,41 +18,43 @@ #include "misc.h" -const uint8_t fm_resume_countdown_500ms = 2500 / 500; // 2.5 seconds -const uint8_t fm_radio_countdown_500ms = 2000 / 500; // 2 seconds -const uint16_t fm_play_countdown_scan_10ms = 100 / 10; // 100ms -const uint16_t fm_play_countdown_noscan_10ms = 1200 / 10; // 1.2 seconds +const uint8_t fm_resume_countdown_500ms = 2500 / 500; // 2.5 seconds +const uint8_t fm_radio_countdown_500ms = 2000 / 500; // 2 seconds +const uint16_t fm_play_countdown_scan_10ms = 100 / 10; // 100ms +const uint16_t fm_play_countdown_noscan_10ms = 1200 / 10; // 1.2 seconds + +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 menu_timeout_500ms = 20000 / 500; // 20 seconds +const uint8_t key_input_timeout_500ms = 8000 / 500; // 8 seconds + +const uint16_t key_repeat_delay_10ms = 400 / 10; // 400ms +const uint16_t key_repeat_10ms = 80 / 10; // 80ms .. MUST be less than 'key_repeat_delay' +const uint16_t key_debounce_10ms = 20 / 10; // 20ms + +const uint8_t scan_delay_10ms = 210 / 10; // 210ms + +// 10ms count down resolution +const uint16_t dual_watch_count_after_tx_10ms = 3600 / 10; // 3.6 sec after TX ends +const uint16_t dual_watch_count_after_rx_10ms = 1000 / 10; // 1 sec after RX ends ? +const uint16_t dual_watch_count_after_1_10ms = 5000 / 10; // 5 sec +const uint16_t dual_watch_count_after_2_10ms = 3600 / 10; // 3.6 sec +const uint16_t dual_watch_count_toggle_10ms = 100 / 10; // 100ms between VFO toggles +const uint16_t dual_watch_count_noaa_10ms = 70 / 10; // 70ms +const uint16_t dual_watch_count_after_vox_10ms = 200 / 10; // 200ms + +const uint16_t battery_save_count_10ms = 10000 / 10; // 10 seconds + +const uint16_t gMax_bat_v = 843; // 8.43V +const uint16_t gMin_bat_v = 660; // 6.6V -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 key_input_timeout_500ms = 8000 / 500; // 8 seconds - -const uint16_t key_repeat_delay_10ms = 400 / 10; // 400ms -const uint16_t key_repeat_10ms = 80 / 10; // 80ms .. MUST be less than 'key_repeat_delay' -const uint16_t key_debounce_10ms = 20 / 10; // 20ms - -const uint8_t scan_delay_10ms = 210 / 10; // 210ms - -// 10ms count down resolution -const uint16_t dual_watch_count_after_tx_10ms = 3600 / 10; // 3.6 sec after TX ends -const uint16_t dual_watch_count_after_rx_10ms = 1000 / 10; // 1 sec after RX ends ? -const uint16_t dual_watch_count_after_1_10ms = 5000 / 10; // 5 sec -const uint16_t dual_watch_count_after_2_10ms = 3600 / 10; // 3.6 sec -const uint16_t dual_watch_count_toggle_10ms = 100 / 10; // 100ms between VFO toggles -const uint16_t dual_watch_count_noaa_10ms = 70 / 10; // 70ms -const uint16_t dual_watch_count_after_vox_10ms = 200 / 10; // 200ms - -const uint16_t battery_save_count_10ms = 10000 / 10; // 10 seconds - -const uint16_t gMax_bat_v = 843; // 8.43V -const uint16_t gMin_bat_v = 660; // 6.6V - -const uint32_t gDefaultAesKey[4] = {0x4AA5CC60, 0x0312CC5F, 0xFFD2DABB, 0x6BBA7F92}; - -const uint8_t gMicGain_dB2[5] = {3, 8, 16, 24, 31}; +const uint32_t gDefaultAesKey[4] = {0x4AA5CC60, 0x0312CC5F, 0xFFD2DABB, 0x6BBA7F92}; + +const uint8_t gMicGain_dB2[5] = {3, 8, 16, 24, 31}; bool gSetting_350TX; bool gSetting_KILLED; diff --git a/misc.h b/misc.h index 4062f02..8b1627e 100644 --- a/misc.h +++ b/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; diff --git a/radio.c b/radio.c index 4a3f174..f63dfb4 100644 --- a/radio.c +++ b/radio.c @@ -913,9 +913,9 @@ Skip: { if (gDTMF_CallMode == DTMF_CALL_MODE_DTMF) { - gDTMF_IsTx = true; - gDTMF_CallState = DTMF_CALL_STATE_NONE; - gDTMF_TxStopCountdown = 6; + gDTMF_IsTx = true; + gDTMF_CallState = DTMF_CALL_STATE_NONE; + gDTMF_TxStopCountdown_500ms = DTMF_txstop_countdown_500ms; } else { diff --git a/ui/main.c b/ui/main.c index 3e22201..919e08e 100644 --- a/ui/main.c +++ b/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 {