mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-27 22:01:26 +03:00
added DTMF call/page compile option
This commit is contained in:
parent
0a9000a34c
commit
8084a92c39
26
Makefile
26
Makefile
@ -27,7 +27,7 @@ ENABLE_NOAA := 0
|
||||
ENABLE_VOICE := 0
|
||||
ENABLE_MUTE_RADIO_FOR_VOICE := 0
|
||||
# Tx on Voice 1.0 kB
|
||||
ENABLE_VOX := 0
|
||||
ENABLE_VOX := 1
|
||||
ENABLE_VOX_MORE_SENSITIVE := 1
|
||||
# Tx Alarm 600 B
|
||||
ENABLE_ALARM := 0
|
||||
@ -40,11 +40,15 @@ ENABLE_MDC1200_SIDE_BEEP := 1
|
||||
ENABLE_PWRON_PASSWORD := 0
|
||||
ENABLE_RESET_AES_KEY := 0
|
||||
ENABLE_BIG_FREQ := 0
|
||||
ENABLE_DTMF_LIVE_DECODER := 0
|
||||
ENABLE_DTMF_CALLING := 0
|
||||
ENABLE_DTMF_LIVE_DECODER := 1
|
||||
ENABLE_DTMF_TIMING_SETTINGS := 0
|
||||
ENABLE_DTMF_CALL_FLASH_LIGHT := 0
|
||||
# Kill and Revive 400 B
|
||||
ENABLE_DTMF_KILL_REVIVE := 0
|
||||
ENABLE_SHOW_FREQ_IN_CHAN := 1
|
||||
# smaa bold 580 B
|
||||
ENABLE_SMALL_BOLD := 0
|
||||
ENABLE_SMALL_BOLD := 1
|
||||
# smallest font 2 kB
|
||||
ENABLE_SMALLEST_FONT := 0
|
||||
# trim trailing 44 B
|
||||
@ -60,19 +64,16 @@ ENABLE_TX_POWER_FIX := 1
|
||||
ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1
|
||||
ENABLE_CONTRAST := 0
|
||||
ENABLE_BOOT_BEEPS := 0
|
||||
ENABLE_DTMF_CALL_FLASH_LIGHT := 0
|
||||
ENABLE_FLASH_LIGHT_SOS_TONE := 0
|
||||
ENABLE_SHOW_CHARGE_LEVEL := 0
|
||||
ENABLE_REVERSE_BAT_SYMBOL := 0
|
||||
ENABLE_FREQ_SEARCH_LNA := 0
|
||||
ENABLE_FREQ_SEARCH_LNA := 1
|
||||
ENABLE_FREQ_SEARCH_TIMEOUT := 0
|
||||
ENABLE_CODE_SEARCH_TIMEOUT := 0
|
||||
# scan ignore list 740 B
|
||||
ENABLE_SCAN_IGNORE_LIST := 0
|
||||
ENABLE_SCAN_IGNORE_LIST := 1
|
||||
# scan ranges 400 B
|
||||
ENABLE_SCAN_RANGES := 0
|
||||
# Kill and Revive 400 B
|
||||
ENABLE_KILL_REVIVE := 0
|
||||
ENABLE_SCAN_RANGES := 1
|
||||
# AM Fix 800 B
|
||||
ENABLE_AM_FIX := 1
|
||||
ENABLE_AM_FIX_SHOW_DATA := 0
|
||||
@ -334,6 +335,9 @@ endif
|
||||
ifeq ($(ENABLE_BIG_FREQ),1)
|
||||
CFLAGS += -DENABLE_BIG_FREQ
|
||||
endif
|
||||
ifeq ($(ENABLE_DTMF_CALLING),1)
|
||||
CFLAGS += -DENABLE_DTMF_CALLING
|
||||
endif
|
||||
ifeq ($(ENABLE_DTMF_LIVE_DECODER),1)
|
||||
CFLAGS += -DENABLE_DTMF_LIVE_DECODER
|
||||
endif
|
||||
@ -439,8 +443,8 @@ endif
|
||||
ifeq ($(ENABLE_SCAN_RANGES),1)
|
||||
CFLAGS += -DENABLE_SCAN_RANGES
|
||||
endif
|
||||
ifeq ($(ENABLE_KILL_REVIVE),1)
|
||||
CFLAGS += -DENABLE_KILL_REVIVE
|
||||
ifeq ($(ENABLE_DTMF_KILL_REVIVE),1)
|
||||
CFLAGS += -DENABLE_DTMF_KILL_REVIVE
|
||||
endif
|
||||
ifeq ($(ENABLE_FREQ_SEARCH_LNA),1)
|
||||
CFLAGS += -DENABLE_FREQ_SEARCH_LNA
|
||||
|
@ -64,8 +64,10 @@ ENABLE_MDC1200_SIDE_BEEP := 1 enable short side tone/beep when MDC
|
||||
ENABLE_PWRON_PASSWORD := 0 include power-on password code
|
||||
ENABLE_RESET_AES_KEY := 1 '1' = reset/clear the AES key stored in the eeprom (only if it's set)
|
||||
ENABLE_BIG_FREQ := 0 big font frequencies (like original QS firmware)
|
||||
ENABLE_DTMF_CALLING := 0 enable the DTMF calling/paging features
|
||||
ENABLE_DTMF_LIVE_DECODER := 0 enable the live DTMF display/decoder .. adds a menu option
|
||||
ENABLE_DTMF_TIMING_SETTINGS := 0 enable the DTMF timing settings in the menu
|
||||
ENABLE_DTMF_CALL_FLASH_LIGHT := 0 flash the flash light LED when a DTMF call is received
|
||||
ENABLE_SHOW_FREQ_IN_CHAN := 0 indicate if frequency found in a channel
|
||||
ENABLE_SMALL_BOLD := 0 bold channel name/no. (when name + freq channel display mode)
|
||||
ENABLE_TRIM_TRAILING_ZEROS := 0 trim away any trailing zeros on frequencies
|
||||
@ -79,7 +81,6 @@ ENABLE_TX_POWER_FIX := 1 fix the TX output power, L ~ 10mW, M
|
||||
ENABLE_CTCSS_TAIL_PHASE_SHIFT := 0 standard CTCSS tail phase shift rather than QS's own 55Hz tone method
|
||||
ENABLE_CONTRAST := 0 add contrast menu
|
||||
ENABLE_BOOT_BEEPS := 0 gives user audio feedback on volume knob position at boot-up
|
||||
ENABLE_DTMF_CALL_FLASH_LIGHT := 0 flash the flash light LED when a DTMF call is received
|
||||
ENABLE_FLASH_LIGHT_SOS_TONE := 0 also do SOS in morse
|
||||
ENABLE_SHOW_CHARGE_LEVEL := 0 show the charge level when the radio is on charge
|
||||
ENABLE_REVERSE_BAT_SYMBOL := 0 mirror the battery symbol on the status bar (+ pole on the right)
|
||||
@ -88,7 +89,7 @@ ENABLE_FREQ_SEARCH_TIMEOUT := 0 timeout if FREQ not found when using
|
||||
ENABLE_CODE_SEARCH_TIMEOUT := 0 timeout if CTCSS/CDCSS not found when using F+* search function
|
||||
ENABLE_SCAN_IGNORE_LIST := 0 ignore selected frequencies when scanning - add freqs to list with short */scan button when freq scanning, remove freq from list with long press MENU when not scanning
|
||||
ENABLE_SCAN_RANGES := 0 adds menu option to auto select frequency scan range/step depending on your initial frequency
|
||||
ENABLE_KILL_REVIVE := 0 include kill and revive code
|
||||
ENABLE_DTMF_KILL_REVIVE := 0 include kill and revive code
|
||||
ENABLE_AM_FIX := 1 dynamically adjust the front end gains when in AM mode to help prevent AM demodulator saturation, ignore the on-screen RSSI level (for now)
|
||||
ENABLE_AM_FIX_SHOW_DATA := 0 show debug data for the AM fix (still tweaking it)
|
||||
ENABLE_SQUELCH_MORE_SENSITIVE := 1 make squelch levels a little bit more sensitive - I plan to let user adjust the values themselves
|
||||
|
@ -207,7 +207,9 @@ void ACTION_Scan(bool bRestart)
|
||||
g_monitor_enabled = false;
|
||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
DTMF_clear_RX();
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
g_dtmf_rx_live_timeout = 0;
|
||||
|
38
app/app.c
38
app/app.c
@ -198,8 +198,10 @@ static void APP_process_new_receive(void)
|
||||
if (!g_squelch_open && !g_monitor_enabled)
|
||||
{ // squelch is closed
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (g_dtmf_rx_index > 0)
|
||||
DTMF_clear_RX();
|
||||
#endif
|
||||
|
||||
if (g_current_function != FUNCTION_FOREGROUND)
|
||||
{
|
||||
@ -250,10 +252,11 @@ static void APP_process_new_receive(void)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (g_scan_state_dir == SCAN_STATE_DIR_OFF && g_css_scan_mode == CSS_SCAN_MODE_OFF)
|
||||
{ // not scanning
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||
if (g_rx_vfo->channel.dtmf_decoding_enable || g_eeprom.config.setting.radio_disabled)
|
||||
#else
|
||||
if (g_rx_vfo->channel.dtmf_decoding_enable)
|
||||
@ -276,6 +279,7 @@ static void APP_process_new_receive(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
APP_start_listening();
|
||||
}
|
||||
@ -487,10 +491,12 @@ bool APP_start_listening(void)
|
||||
const unsigned int chan = g_rx_vfo_num;
|
||||
// const unsigned int chan = g_rx_vfo->channel_save;
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||
if (g_eeprom.config.setting.radio_disabled)
|
||||
return false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (g_squelch_open)
|
||||
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_GREEN, true); // green LED on
|
||||
@ -882,8 +888,10 @@ static bool APP_toggle_dual_watch_vfo(void)
|
||||
return false;
|
||||
if (g_ptt_is_pressed)
|
||||
return false;
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
||||
return false;
|
||||
#endif
|
||||
#ifdef ENABLE_FMRADIO
|
||||
if (g_fm_radio_mode)
|
||||
return false;
|
||||
@ -1024,7 +1032,8 @@ void APP_process_radio_interrupts(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||
if (g_rx_vfo->channel.dtmf_decoding_enable || g_eeprom.config.setting.radio_disabled)
|
||||
#else
|
||||
if (g_rx_vfo->channel.dtmf_decoding_enable)
|
||||
@ -1042,6 +1051,7 @@ void APP_process_radio_interrupts(void)
|
||||
|
||||
DTMF_HandleRequest();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -1272,10 +1282,12 @@ void APP_end_tx(void)
|
||||
|
||||
g_update_status = true;
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||
if (g_eeprom.config.setting.radio_disabled)
|
||||
return;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (!g_eeprom.config.setting.tx_enable)
|
||||
return;
|
||||
@ -1319,10 +1331,12 @@ void APP_process_keys(void)
|
||||
|
||||
key_code_t key;
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||
if (g_eeprom.config.setting.radio_disabled)
|
||||
return;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// *****************
|
||||
// PTT is treated completely separately from all the other buttons
|
||||
@ -1345,7 +1359,7 @@ void APP_process_keys(void)
|
||||
if (g_current_display_screen != DISPLAY_AIRCOPY)
|
||||
#endif
|
||||
{
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#if defined(ENABLE_DTMF_CALLING) && defined(ENABLE_DTMF_KILL_REVIVE)
|
||||
if (!g_eeprom.config.setting.radio_disabled)
|
||||
#endif
|
||||
{
|
||||
@ -1929,7 +1943,9 @@ void APP_process_power_save(void)
|
||||
g_scan_state_dir != SCAN_STATE_DIR_OFF ||
|
||||
g_css_scan_mode != CSS_SCAN_MODE_OFF ||
|
||||
g_current_display_screen != DISPLAY_MAIN ||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
#endif
|
||||
g_flash_light_state == FLASHLIGHT_SOS)
|
||||
{
|
||||
power_save = false;
|
||||
@ -2129,9 +2145,11 @@ void APP_time_slice_500ms(void)
|
||||
if (--g_menu_tick_10ms == 0)
|
||||
exit_menu = (g_current_display_screen == DISPLAY_MENU); // exit menu mode
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (g_dtmf_rx_timeout > 0)
|
||||
if (--g_dtmf_rx_timeout == 0)
|
||||
DTMF_clear_RX();
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
if (g_fm_radio_tick_500ms > 0)
|
||||
@ -2350,6 +2368,7 @@ void APP_time_slice_500ms(void)
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (g_current_function != FUNCTION_TRANSMIT)
|
||||
{
|
||||
if (g_dtmf_decode_ring_tick_500ms > 0)
|
||||
@ -2392,6 +2411,7 @@ void APP_time_slice_500ms(void)
|
||||
// g_update_display = true;
|
||||
// }
|
||||
}
|
||||
#endif
|
||||
|
||||
if (g_dtmf_is_tx && g_dtmf_tx_stop_tick_500ms > 0)
|
||||
{
|
||||
@ -2636,7 +2656,7 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const
|
||||
#ifdef ENABLE_AIRCOPY
|
||||
if (g_current_display_screen == DISPLAY_AIRCOPY)
|
||||
{
|
||||
AIRCOPY_process_key(key, key_pressed, key_held);
|
||||
AIRCOPY_process_key(Key, key_pressed, key_held);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@ -2755,8 +2775,10 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const
|
||||
g_menu_tick_10ms = menu_timeout_500ms;
|
||||
|
||||
// cancel the ringing
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (key_pressed && g_dtmf_decode_ring_tick_500ms > 0)
|
||||
g_dtmf_decode_ring_tick_500ms = 0;
|
||||
#endif
|
||||
|
||||
// ********************
|
||||
|
||||
@ -3063,8 +3085,10 @@ Skip:
|
||||
|
||||
// g_tx_vfo->freq_in_channel = SETTINGS_find_channel(frequency);
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
g_dtmf_auto_reset_time_500ms = 0;
|
||||
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
||||
#endif
|
||||
g_dtmf_tx_stop_tick_500ms = 0;
|
||||
g_dtmf_is_tx = false;
|
||||
|
||||
|
106
app/dtmf.c
106
app/dtmf.c
@ -41,38 +41,43 @@ uint8_t g_dtmf_input_box_index;
|
||||
bool g_dtmf_input_mode;
|
||||
uint8_t g_dtmf_prev_index;
|
||||
|
||||
char g_dtmf_rx[17];
|
||||
uint8_t g_dtmf_rx_index;
|
||||
uint8_t g_dtmf_rx_timeout;
|
||||
bool g_dtmf_rx_pending;
|
||||
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
char g_dtmf_rx_live[20];
|
||||
uint8_t g_dtmf_rx_live_timeout;
|
||||
#endif
|
||||
|
||||
bool g_dtmf_is_contact_valid;
|
||||
char g_dtmf_id[4];
|
||||
char g_dtmf_caller[4];
|
||||
char g_dtmf_callee[4];
|
||||
dtmf_state_t g_dtmf_state;
|
||||
uint8_t g_dtmf_decode_ring_tick_500ms;
|
||||
uint8_t g_dtmf_chosen_contact;
|
||||
uint8_t g_dtmf_auto_reset_time_500ms;
|
||||
dtmf_call_state_t g_dtmf_call_state;
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
char g_dtmf_rx[17];
|
||||
uint8_t g_dtmf_rx_index;
|
||||
uint8_t g_dtmf_rx_timeout;
|
||||
bool g_dtmf_rx_pending;
|
||||
|
||||
bool g_dtmf_is_contact_valid;
|
||||
char g_dtmf_id[4];
|
||||
char g_dtmf_caller[4];
|
||||
char g_dtmf_callee[4];
|
||||
dtmf_state_t g_dtmf_state;
|
||||
uint8_t g_dtmf_decode_ring_tick_500ms;
|
||||
uint8_t g_dtmf_chosen_contact;
|
||||
uint8_t g_dtmf_auto_reset_time_500ms;
|
||||
dtmf_call_state_t g_dtmf_call_state;
|
||||
dtmf_call_mode_t g_dtmf_call_mode;
|
||||
bool g_dtmf_IsGroupCall;
|
||||
#endif
|
||||
|
||||
dtmf_reply_state_t g_dtmf_reply_state;
|
||||
dtmf_call_mode_t g_dtmf_call_mode;
|
||||
bool g_dtmf_is_tx;
|
||||
uint8_t g_dtmf_tx_stop_tick_500ms;
|
||||
bool g_dtmf_IsGroupCall;
|
||||
|
||||
void DTMF_clear_RX(void)
|
||||
{
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
void DTMF_clear_RX(void)
|
||||
{
|
||||
g_dtmf_rx_timeout = 0;
|
||||
g_dtmf_rx_index = 0;
|
||||
g_dtmf_rx_pending = false;
|
||||
memset(g_dtmf_rx, 0, sizeof(g_dtmf_rx));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool DTMF_ValidateCodes(char *pCode, const unsigned int size)
|
||||
{
|
||||
@ -96,20 +101,21 @@ bool DTMF_ValidateCodes(char *pCode, const unsigned int size)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DTMF_GetContact(const int Index, char *pContact)
|
||||
{
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
bool DTMF_GetContact(const int Index, char *pContact)
|
||||
{
|
||||
int i = -1;
|
||||
if (Index >= 0 && Index < (int)ARRAY_SIZE(g_eeprom.config.dtmf_contact))
|
||||
{
|
||||
memcpy(pContact, &g_eeprom.config.dtmf_contact[Index], 16);
|
||||
// EEPROM_ReadBuffer(0x1C00 + (Index * 16), pContact, 16);
|
||||
// EEPROM_ReadBuffer(0x1C00 + (Index * 16), pContact, 16);
|
||||
i = (int)pContact[0] - ' ';
|
||||
}
|
||||
return (i < 0 || i >= 95) ? false : true;
|
||||
}
|
||||
}
|
||||
|
||||
bool DTMF_FindContact(const char *pContact, char *pResult)
|
||||
{
|
||||
bool DTMF_FindContact(const char *pContact, char *pResult)
|
||||
{
|
||||
char Contact[16];
|
||||
unsigned int i;
|
||||
|
||||
@ -133,7 +139,8 @@ bool DTMF_FindContact(const char *pContact, char *pResult)
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
char DTMF_GetCharacter(const unsigned int code)
|
||||
{
|
||||
@ -159,8 +166,9 @@ char DTMF_GetCharacter(const unsigned int code)
|
||||
}
|
||||
}
|
||||
|
||||
bool DTMF_CompareMessage(const char *pMsg, const char *pTemplate, const unsigned int size, const bool bCheckGroup)
|
||||
{
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
bool DTMF_CompareMessage(const char *pMsg, const char *pTemplate, const unsigned int size, const bool bCheckGroup)
|
||||
{
|
||||
unsigned int i;
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
@ -173,17 +181,18 @@ bool DTMF_CompareMessage(const char *pMsg, const char *pTemplate, const unsigned
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
dtmf_call_mode_t DTMF_CheckGroupCall(const char *pMsg, const unsigned int size)
|
||||
{
|
||||
dtmf_call_mode_t DTMF_CheckGroupCall(const char *pMsg, const unsigned int size)
|
||||
{
|
||||
unsigned int i;
|
||||
for (i = 0; i < size; i++)
|
||||
if (pMsg[i] == g_eeprom.config.setting.dtmf.group_call_code)
|
||||
break;
|
||||
|
||||
return (i < size) ? DTMF_CALL_MODE_GROUP : DTMF_CALL_MODE_NOT_GROUP;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void DTMF_clear_input_box(void)
|
||||
{
|
||||
@ -204,8 +213,9 @@ void DTMF_Append(const char code)
|
||||
g_dtmf_input_box[g_dtmf_input_box_index++] = code;
|
||||
}
|
||||
|
||||
void DTMF_HandleRequest(void)
|
||||
{ // proccess the RX'ed DTMF characters
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
void DTMF_HandleRequest(void)
|
||||
{ // proccess the RX'ed DTMF characters
|
||||
|
||||
char String[21];
|
||||
unsigned int Offset;
|
||||
@ -219,7 +229,7 @@ void DTMF_HandleRequest(void)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||
if (!g_rx_vfo->channel.dtmf_decoding_enable && !g_eeprom.config.setting.radio_disabled)
|
||||
#else
|
||||
if (!g_rx_vfo->channel.dtmf_decoding_enable)
|
||||
@ -231,7 +241,7 @@ void DTMF_HandleRequest(void)
|
||||
|
||||
g_dtmf_rx_pending = false;
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||
if (g_dtmf_rx_index >= 9)
|
||||
{ // look for the RADIO DISABLE code
|
||||
|
||||
@ -310,7 +320,7 @@ void DTMF_HandleRequest(void)
|
||||
{ // ends with "AB"
|
||||
|
||||
if (g_dtmf_reply_state != DTMF_REPLY_NONE) // 1of11
|
||||
// if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT) // 1of11
|
||||
// if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT) // 1of11
|
||||
{
|
||||
g_dtmf_state = DTMF_STATE_TX_SUCC;
|
||||
DTMF_clear_RX();
|
||||
@ -337,7 +347,7 @@ void DTMF_HandleRequest(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||
if (g_eeprom.config.setting.radio_disabled)
|
||||
return; // we've been disabled
|
||||
#endif
|
||||
@ -389,16 +399,24 @@ void DTMF_HandleRequest(void)
|
||||
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool DTMF_Reply(void)
|
||||
{
|
||||
const uint16_t delay_ms = ((g_eeprom.config.setting.dtmf.preload_time < 15) ? 15 : g_eeprom.config.setting.dtmf.preload_time) * 10;
|
||||
const char *pString = NULL;
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
char str[23];
|
||||
#endif
|
||||
|
||||
switch (g_dtmf_reply_state)
|
||||
{
|
||||
case DTMF_REPLY_STR:
|
||||
pString = g_dtmf_string;
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
case DTMF_REPLY_ANI:
|
||||
pString = g_dtmf_string;
|
||||
|
||||
@ -423,14 +441,18 @@ bool DTMF_Reply(void)
|
||||
pString = str;
|
||||
break;
|
||||
|
||||
default:
|
||||
case DTMF_REPLY_NONE:
|
||||
#endif
|
||||
|
||||
default:
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
// UART_printf("dtmf tx reply none %s\r\n", g_dtmf_string);
|
||||
#endif
|
||||
|
||||
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
if (
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
#endif
|
||||
g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_APOLLO ||
|
||||
g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_OFF ||
|
||||
g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_EOT)
|
||||
@ -446,7 +468,7 @@ bool DTMF_Reply(void)
|
||||
|
||||
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
||||
|
||||
if (pString == NULL)
|
||||
if (pString == NULL || strlen(pString) == 0)
|
||||
return false;
|
||||
|
||||
if (g_eeprom.config.setting.dtmf.side_tone)
|
||||
|
86
app/dtmf.h
86
app/dtmf.h
@ -34,36 +34,45 @@ enum dtmf_state_e {
|
||||
};
|
||||
typedef enum dtmf_state_e dtmf_state_t;
|
||||
|
||||
enum dtmf_call_state_e {
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
enum dtmf_call_state_e {
|
||||
DTMF_CALL_STATE_NONE = 0,
|
||||
DTMF_CALL_STATE_CALL_OUT,
|
||||
DTMF_CALL_STATE_RECEIVED,
|
||||
DTMF_CALL_STATE_RECEIVED_STAY
|
||||
};
|
||||
typedef enum dtmf_call_state_e dtmf_call_state_t;
|
||||
};
|
||||
typedef enum dtmf_call_state_e dtmf_call_state_t;
|
||||
|
||||
enum dtmf_decode_response_e {
|
||||
enum dtmf_decode_response_e {
|
||||
DTMF_DEC_RESPONSE_NONE = 0,
|
||||
DTMF_DEC_RESPONSE_RING,
|
||||
DTMF_DEC_RESPONSE_REPLY,
|
||||
DTMF_DEC_RESPONSE_BOTH
|
||||
};
|
||||
typedef enum dtmf_decode_response_e dtmf_decode_response_t;
|
||||
};
|
||||
typedef enum dtmf_decode_response_e dtmf_decode_response_t;
|
||||
|
||||
enum dtmf_reply_state_e {
|
||||
enum dtmf_reply_state_e {
|
||||
DTMF_REPLY_NONE = 0,
|
||||
DTMF_REPLY_STR,
|
||||
DTMF_REPLY_ANI,
|
||||
DTMF_REPLY_AB,
|
||||
DTMF_REPLY_AAAAA
|
||||
};
|
||||
typedef enum dtmf_reply_state_e dtmf_reply_state_t;
|
||||
};
|
||||
typedef enum dtmf_reply_state_e dtmf_reply_state_t;
|
||||
|
||||
enum dtmf_call_mode_e {
|
||||
enum dtmf_call_mode_e {
|
||||
DTMF_CALL_MODE_NOT_GROUP = 0,
|
||||
DTMF_CALL_MODE_GROUP,
|
||||
DTMF_CALL_MODE_DTMF
|
||||
};
|
||||
typedef enum dtmf_call_mode_e dtmf_call_mode_t;
|
||||
};
|
||||
typedef enum dtmf_call_mode_e dtmf_call_mode_t;
|
||||
#else
|
||||
enum dtmf_reply_state_e {
|
||||
DTMF_REPLY_NONE = 0,
|
||||
DTMF_REPLY_STR
|
||||
};
|
||||
typedef enum dtmf_reply_state_e dtmf_reply_state_t;
|
||||
#endif
|
||||
|
||||
extern char g_dtmf_string[15];
|
||||
|
||||
@ -72,40 +81,51 @@ extern uint8_t g_dtmf_input_box_index;
|
||||
extern bool g_dtmf_input_mode;
|
||||
extern uint8_t g_dtmf_prev_index;
|
||||
|
||||
extern char g_dtmf_rx[17];
|
||||
extern uint8_t g_dtmf_rx_index;
|
||||
extern uint8_t g_dtmf_rx_timeout;
|
||||
extern bool g_dtmf_rx_pending;
|
||||
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
extern char g_dtmf_rx_live[20];
|
||||
extern uint8_t g_dtmf_rx_live_timeout;
|
||||
#endif
|
||||
|
||||
extern bool g_dtmf_is_contact_valid;
|
||||
extern char g_dtmf_id[4];
|
||||
extern char g_dtmf_caller[4];
|
||||
extern char g_dtmf_callee[4];
|
||||
extern dtmf_state_t g_dtmf_state;
|
||||
extern uint8_t g_dtmf_decode_ring_tick_500ms;
|
||||
extern uint8_t g_dtmf_chosen_contact;
|
||||
extern uint8_t g_dtmf_auto_reset_time_500ms;
|
||||
extern dtmf_call_state_t g_dtmf_call_state;
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
extern char g_dtmf_rx[17];
|
||||
extern uint8_t g_dtmf_rx_index;
|
||||
extern uint8_t g_dtmf_rx_timeout;
|
||||
extern bool g_dtmf_rx_pending;
|
||||
|
||||
extern bool g_dtmf_is_contact_valid;
|
||||
extern char g_dtmf_id[4];
|
||||
extern char g_dtmf_caller[4];
|
||||
extern char g_dtmf_callee[4];
|
||||
extern dtmf_state_t g_dtmf_state;
|
||||
extern uint8_t g_dtmf_decode_ring_tick_500ms;
|
||||
extern uint8_t g_dtmf_chosen_contact;
|
||||
extern uint8_t g_dtmf_auto_reset_time_500ms;
|
||||
extern dtmf_call_state_t g_dtmf_call_state;
|
||||
extern dtmf_call_mode_t g_dtmf_call_mode;
|
||||
#endif
|
||||
|
||||
extern dtmf_reply_state_t g_dtmf_reply_state;
|
||||
extern dtmf_call_mode_t g_dtmf_call_mode;
|
||||
extern bool g_dtmf_is_tx;
|
||||
extern uint8_t g_dtmf_tx_stop_tick_500ms;
|
||||
|
||||
void DTMF_clear_RX(void);
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
void DTMF_clear_RX(void);
|
||||
#endif
|
||||
bool DTMF_ValidateCodes(char *pCode, const unsigned int size);
|
||||
bool DTMF_GetContact(const int Index, char *pContact);
|
||||
bool DTMF_FindContact(const char *pContact, char *pResult);
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
bool DTMF_GetContact(const int Index, char *pContact);
|
||||
bool DTMF_FindContact(const char *pContact, char *pResult);
|
||||
#endif
|
||||
char DTMF_GetCharacter(const unsigned int code);
|
||||
bool DTMF_CompareMessage(const char *pDTMF, const char *pTemplate, const unsigned int size, const bool flag);
|
||||
dtmf_call_mode_t DTMF_CheckGroupCall(const char *pDTMF, const unsigned int size);
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
bool DTMF_CompareMessage(const char *pDTMF, const char *pTemplate, const unsigned int size, const bool flag);
|
||||
dtmf_call_mode_t DTMF_CheckGroupCall(const char *pDTMF, const unsigned int size);
|
||||
#endif
|
||||
void DTMF_clear_input_box(void);
|
||||
void DTMF_Append(const char vode);
|
||||
void DTMF_HandleRequest(void);
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
void DTMF_HandleRequest(void);
|
||||
#endif
|
||||
bool DTMF_Reply(void);
|
||||
|
||||
#endif
|
||||
|
@ -214,6 +214,7 @@ void GENERIC_Key_PTT(bool key_pressed)
|
||||
g_dtmf_input_box[g_dtmf_input_box_index] = 0; // NULL term the string
|
||||
|
||||
// append our DTMF ID to the inputted DTMF code -
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
#if 0
|
||||
// QS
|
||||
if (g_dtmf_input_box_index == 3)
|
||||
@ -227,13 +228,18 @@ void GENERIC_Key_PTT(bool key_pressed)
|
||||
else
|
||||
g_dtmf_call_mode = DTMF_CALL_MODE_DTMF;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// remember the DTMF string
|
||||
g_dtmf_prev_index = g_dtmf_input_box_index;
|
||||
strcpy(g_dtmf_string, g_dtmf_input_box);
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
g_dtmf_reply_state = DTMF_REPLY_ANI;
|
||||
g_dtmf_state = DTMF_STATE_0;
|
||||
#else
|
||||
g_dtmf_reply_state = DTMF_REPLY_STR; // just send the straight string
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
// UART_printf("generic ptt tx %s\r\n", g_dtmf_string);
|
||||
|
@ -703,12 +703,14 @@ void MAIN_Key_EXIT(bool key_pressed, bool key_held)
|
||||
|
||||
g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE && g_current_function != FUNCTION_TRANSMIT)
|
||||
{ // clear CALL mode being displayed
|
||||
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
||||
g_update_display = true;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
if (!g_fm_radio_mode)
|
||||
|
110
app/menu.c
110
app/menu.c
@ -261,7 +261,9 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
||||
case MENU_S_ADD2:
|
||||
case MENU_STE:
|
||||
case MENU_DTMF_ST:
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
case MENU_DTMF_DCD:
|
||||
#endif
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
case MENU_DTMF_LIVE_DEC:
|
||||
#endif
|
||||
@ -322,11 +324,6 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
||||
*pMax = 2;
|
||||
break;
|
||||
|
||||
case MENU_DTMF_RSP:
|
||||
*pMin = 0;
|
||||
*pMax = ARRAY_SIZE(g_sub_menu_dtmf_rsp) - 1;
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_MDC1200
|
||||
case MENU_MDC1200_MODE:
|
||||
*pMin = 0;
|
||||
@ -344,9 +341,10 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
||||
*pMax = ARRAY_SIZE(g_sub_menu_ptt_id) - 1;
|
||||
break;
|
||||
|
||||
case MENU_BAT_TXT:
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
case MENU_DTMF_RSP:
|
||||
*pMin = 0;
|
||||
*pMax = ARRAY_SIZE(g_sub_menu_bat_text) - 1;
|
||||
*pMax = ARRAY_SIZE(g_sub_menu_dtmf_rsp) - 1;
|
||||
break;
|
||||
|
||||
case MENU_DTMF_HOLD:
|
||||
@ -354,6 +352,17 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
||||
*pMax = DTMF_HOLD_MAX;
|
||||
break;
|
||||
|
||||
case MENU_DTMF_LIST:
|
||||
*pMin = 1;
|
||||
*pMax = 16;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case MENU_BAT_TXT:
|
||||
*pMin = 0;
|
||||
*pMax = ARRAY_SIZE(g_sub_menu_bat_text) - 1;
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_DTMF_TIMING_SETTINGS
|
||||
case MENU_DTMF_PRE:
|
||||
*pMin = 3;
|
||||
@ -369,11 +378,6 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
||||
break;
|
||||
#endif
|
||||
|
||||
case MENU_DTMF_LIST:
|
||||
*pMin = 1;
|
||||
*pMax = 16;
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_TX_POWER_CAL_MENU
|
||||
case MENU_TX_CALI:
|
||||
*pMin = 0;
|
||||
@ -741,6 +745,7 @@ void MENU_AcceptSetting(void)
|
||||
g_eeprom.config.setting.dtmf.side_tone = g_sub_menu_selection;
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
case MENU_DTMF_RSP:
|
||||
g_eeprom.config.setting.dtmf.decode_response = g_sub_menu_selection;
|
||||
break;
|
||||
@ -749,6 +754,25 @@ void MENU_AcceptSetting(void)
|
||||
g_eeprom.config.setting.dtmf.auto_reset_time = g_sub_menu_selection;
|
||||
break;
|
||||
|
||||
case MENU_DTMF_DCD:
|
||||
g_tx_vfo->channel.dtmf_decoding_enable = g_sub_menu_selection;
|
||||
DTMF_clear_RX();
|
||||
g_request_save_channel = 1;
|
||||
return;
|
||||
|
||||
case MENU_DTMF_LIST:
|
||||
g_dtmf_chosen_contact = g_sub_menu_selection - 1;
|
||||
if (g_dtmf_is_contact_valid)
|
||||
{
|
||||
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
||||
g_dtmf_input_mode = true;
|
||||
g_dtmf_input_box_index = 3;
|
||||
memcpy(g_dtmf_input_box, g_dtmf_id, 4);
|
||||
g_request_display_screen = DISPLAY_INVALID;
|
||||
}
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DTMF_TIMING_SETTINGS
|
||||
case MENU_DTMF_PRE:
|
||||
g_eeprom.config.setting.dtmf.preload_time = g_sub_menu_selection;
|
||||
@ -798,12 +822,6 @@ void MENU_AcceptSetting(void)
|
||||
g_eeprom.config.setting.battery_text = g_sub_menu_selection;
|
||||
break;
|
||||
|
||||
case MENU_DTMF_DCD:
|
||||
g_tx_vfo->channel.dtmf_decoding_enable = g_sub_menu_selection;
|
||||
DTMF_clear_RX();
|
||||
g_request_save_channel = 1;
|
||||
return;
|
||||
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
case MENU_DTMF_LIVE_DEC:
|
||||
g_eeprom.config.setting.dtmf_live_decoder = g_sub_menu_selection;
|
||||
@ -816,18 +834,6 @@ void MENU_AcceptSetting(void)
|
||||
break;
|
||||
#endif
|
||||
|
||||
case MENU_DTMF_LIST:
|
||||
g_dtmf_chosen_contact = g_sub_menu_selection - 1;
|
||||
if (g_dtmf_is_contact_valid)
|
||||
{
|
||||
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
||||
g_dtmf_input_mode = true;
|
||||
g_dtmf_input_box_index = 3;
|
||||
memcpy(g_dtmf_input_box, g_dtmf_id, 4);
|
||||
g_request_display_screen = DISPLAY_INVALID;
|
||||
}
|
||||
return;
|
||||
|
||||
case MENU_PON_MSG:
|
||||
g_eeprom.config.setting.power_on_display_mode = g_sub_menu_selection;
|
||||
break;
|
||||
@ -1257,16 +1263,17 @@ void MENU_ShowCurrentSetting(void)
|
||||
g_sub_menu_selection = RADIO_FindNextChannel(0, 1, true, 1);
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_ALARM
|
||||
#ifdef ENABLE_ALARM
|
||||
case MENU_ALARM_MODE:
|
||||
g_sub_menu_selection = g_eeprom.config.setting.alarm_mode;
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
case MENU_DTMF_ST:
|
||||
g_sub_menu_selection = g_eeprom.config.setting.dtmf.side_tone;
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
case MENU_DTMF_RSP:
|
||||
g_sub_menu_selection = g_eeprom.config.setting.dtmf.decode_response;
|
||||
break;
|
||||
@ -1299,6 +1306,15 @@ void MENU_ShowCurrentSetting(void)
|
||||
|
||||
break;
|
||||
|
||||
case MENU_DTMF_DCD:
|
||||
g_sub_menu_selection = g_tx_vfo->channel.dtmf_decoding_enable;
|
||||
break;
|
||||
|
||||
case MENU_DTMF_LIST:
|
||||
g_sub_menu_selection = g_dtmf_chosen_contact + 1;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DTMF_TIMING_SETTINGS
|
||||
case MENU_DTMF_PRE:
|
||||
g_sub_menu_selection = g_eeprom.config.setting.dtmf.preload_time;
|
||||
@ -1339,14 +1355,6 @@ void MENU_ShowCurrentSetting(void)
|
||||
g_sub_menu_selection = g_eeprom.config.setting.battery_text;
|
||||
return;
|
||||
|
||||
case MENU_DTMF_DCD:
|
||||
g_sub_menu_selection = g_tx_vfo->channel.dtmf_decoding_enable;
|
||||
break;
|
||||
|
||||
case MENU_DTMF_LIST:
|
||||
g_sub_menu_selection = g_dtmf_chosen_contact + 1;
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
case MENU_DTMF_LIVE_DEC:
|
||||
g_sub_menu_selection = g_eeprom.config.setting.dtmf_live_decoder;
|
||||
@ -1365,33 +1373,33 @@ void MENU_ShowCurrentSetting(void)
|
||||
g_sub_menu_selection = g_tx_vfo->channel.mod_mode;
|
||||
break;
|
||||
/*
|
||||
#ifdef ENABLE_AM_FIX
|
||||
#ifdef ENABLE_AM_FIX
|
||||
case MENU_AM_FIX:
|
||||
g_sub_menu_selection = g_eeprom.config.setting.am_fix;
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
*/
|
||||
#ifdef ENABLE_AM_FIX_TEST1
|
||||
#ifdef ENABLE_AM_FIX_TEST1
|
||||
case MENU_AM_FIX_TEST1:
|
||||
g_sub_menu_selection = g_eeprom.config.setting.am_fix_test1;
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_NOAA
|
||||
#ifdef ENABLE_NOAA
|
||||
case MENU_NOAA_SCAN:
|
||||
g_sub_menu_selection = g_eeprom.config.setting.noaa_auto_scan;
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
case MENU_MEM_DEL:
|
||||
#if 0
|
||||
#if 0
|
||||
g_sub_menu_selection = RADIO_FindNextChannel(g_eeprom.config.setting.indices.vfo[0].user, 1, false, 1);
|
||||
#else
|
||||
#else
|
||||
g_sub_menu_selection = RADIO_FindNextChannel(g_eeprom.config.setting.indices.vfo[g_eeprom.config.setting.tx_vfo_num].user, 1, false, 1);
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_SIDE_BUTT_MENU
|
||||
#ifdef ENABLE_SIDE_BUTT_MENU
|
||||
case MENU_SIDE1_SHORT:
|
||||
g_sub_menu_selection = g_eeprom.config.setting.key1_short;
|
||||
break;
|
||||
@ -1407,7 +1415,7 @@ void MENU_ShowCurrentSetting(void)
|
||||
case MENU_SIDE2_LONG:
|
||||
g_sub_menu_selection = g_eeprom.config.setting.key2_long;
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
case MENU_350_TX:
|
||||
g_sub_menu_selection = g_eeprom.config.setting.enable_tx_350;
|
||||
|
@ -650,7 +650,9 @@ void SEARCH_Start(void)
|
||||
BK4819_EnableFrequencyScan();
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
DTMF_clear_RX();
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_VOX
|
||||
g_vox_lost = false;
|
||||
|
@ -352,7 +352,7 @@ static void cmd_051D(const uint8_t *pBuffer)
|
||||
memset(data, 0xff, 8); // wipe the AES key
|
||||
#endif
|
||||
|
||||
//#ifndef ENABLE_KILL_REVIVE
|
||||
//#ifndef ENABLE_DTMF_KILL_REVIVE
|
||||
if (Offset == 0x0F40)
|
||||
{ // killed flag is here
|
||||
data[2] = false; // remove it
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -56,7 +56,9 @@ void FUNCTION_Init(void)
|
||||
else
|
||||
g_current_code_type = CODE_TYPE_CONTINUOUS_TONE;
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
DTMF_clear_RX();
|
||||
#endif
|
||||
|
||||
g_cxcss_tail_found = false;
|
||||
g_cdcss_lost = false;
|
||||
@ -123,12 +125,14 @@ void FUNCTION_Select(function_type_t Function)
|
||||
g_fm_restore_tick_10ms = g_eeprom.config.setting.scan_hold_time * 50;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT ||
|
||||
g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED ||
|
||||
g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED_STAY)
|
||||
{
|
||||
g_dtmf_auto_reset_time_500ms = g_eeprom.config.setting.dtmf.auto_reset_time * 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
return;
|
||||
|
||||
@ -213,7 +217,9 @@ void FUNCTION_Select(function_type_t Function)
|
||||
BK4819_DisableDTMF();
|
||||
|
||||
// clear the DTMF RX buffer
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
DTMF_clear_RX();
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
// clear the DTMF RX live decoder buffer
|
||||
@ -262,7 +268,9 @@ void FUNCTION_Select(function_type_t Function)
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (!DTMF_Reply())
|
||||
#endif
|
||||
{
|
||||
#ifdef ENABLE_MDC1200
|
||||
if (g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_BOT || g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_BOTH)
|
||||
|
@ -142,7 +142,9 @@ void PAN_process_10ms(void)
|
||||
g_current_display_screen == DISPLAY_SEARCH ||
|
||||
g_css_scan_mode != CSS_SCAN_MODE_OFF ||
|
||||
g_scan_state_dir != SCAN_STATE_DIR_OFF ||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
#endif
|
||||
g_eeprom.config.setting.dual_watch != DUAL_WATCH_OFF)
|
||||
{
|
||||
if (g_panadapter_enabled)
|
||||
|
16
radio.c
16
radio.c
@ -1167,11 +1167,12 @@ void RADIO_PrepareTX(void)
|
||||
// ******************************
|
||||
// TX is allowed
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
UART_printf("radio prepare tx %u %s\r\n", g_dtmf_reply_state, g_dtmf_string);
|
||||
#if defined(ENABLE_DTMF_CALLING) && defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
// UART_printf("radio prepare tx %u %s\r\n", g_dtmf_reply_state, g_dtmf_string);
|
||||
#endif
|
||||
|
||||
if (g_dtmf_reply_state == DTMF_REPLY_ANI)
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (g_dtmf_reply_state == DTMF_REPLY_STR || g_dtmf_reply_state == DTMF_REPLY_ANI)
|
||||
{
|
||||
if (g_dtmf_call_mode == DTMF_CALL_MODE_DTMF)
|
||||
{
|
||||
@ -1185,6 +1186,10 @@ void RADIO_PrepareTX(void)
|
||||
g_dtmf_is_tx = false;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (g_dtmf_reply_state == DTMF_REPLY_STR)
|
||||
g_dtmf_is_tx = false;
|
||||
#endif
|
||||
|
||||
FUNCTION_Select(FUNCTION_TRANSMIT);
|
||||
}
|
||||
@ -1233,7 +1238,10 @@ void RADIO_tx_eot(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (g_dtmf_call_state == DTMF_CALL_STATE_NONE &&
|
||||
if (
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
g_dtmf_call_state == DTMF_CALL_STATE_NONE &&
|
||||
#endif
|
||||
(g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_EOT || g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_BOTH))
|
||||
{ // end-of-tx
|
||||
if (g_eeprom.config.setting.dtmf.side_tone)
|
||||
|
12
settings.c
12
settings.c
@ -236,7 +236,7 @@ void SETTINGS_read_eeprom(void)
|
||||
g_eeprom.config.setting.dtmf.code_persist_time = (g_eeprom.config.setting.dtmf.code_persist_time < 5 || g_eeprom.config.setting.dtmf.code_persist_time > 20) ? 10 : g_eeprom.config.setting.dtmf.code_persist_time;
|
||||
g_eeprom.config.setting.dtmf.code_interval_time = (g_eeprom.config.setting.dtmf.code_interval_time < 5 || g_eeprom.config.setting.dtmf.code_interval_time > 20) ? 10 : g_eeprom.config.setting.dtmf.code_interval_time;
|
||||
#if 0
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||
g_eeprom.config.setting.dtmf.permit_remote_kill = (g_eeprom.config.setting.dtmf.permit_remote_kill < 2) ? g_eeprom.config.setting.dtmf.permit_remote_kill : 0;
|
||||
#else
|
||||
g_eeprom.config.setting.dtmf.permit_remote_kill = 0;
|
||||
@ -249,7 +249,7 @@ void SETTINGS_read_eeprom(void)
|
||||
strcpy(g_eeprom.config.setting.dtmf.ani_id, "123");
|
||||
}
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||
// 0EE8..0EEF
|
||||
if (!DTMF_ValidateCodes(g_eeprom.config.setting.dtmf.kill_code, sizeof(g_eeprom.config.setting.dtmf.kill_code)))
|
||||
{
|
||||
@ -308,7 +308,7 @@ void SETTINGS_read_eeprom(void)
|
||||
// 0F40..0F47
|
||||
g_eeprom.config.setting.freq_lock = (g_eeprom.config.setting.freq_lock < FREQ_LOCK_LAST) ? g_eeprom.config.setting.freq_lock : FREQ_LOCK_NORMAL;
|
||||
// g_eeprom.config.setting.enable_tx_350 = (g_eeprom.config.setting.enable_tx_350 < 2) ? g_eeprom.config.setting.enable_tx_350 : false;
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||
g_eeprom.config.setting.radio_disabled = (g_eeprom.config.setting.radio_disabled < 2) ? g_eeprom.config.setting.radio_disabled : 0;
|
||||
#else
|
||||
g_eeprom.config.setting.radio_disabled = 0;
|
||||
@ -332,7 +332,7 @@ void SETTINGS_read_eeprom(void)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef ENABLE_KILL_REVIVE
|
||||
#ifndef ENABLE_DTMF_KILL_REVIVE
|
||||
memset(g_eeprom.config.setting.dtmf.kill_code, 0, sizeof(g_eeprom.config.setting.dtmf.kill_code));
|
||||
memset(g_eeprom.config.setting.dtmf.revive_code, 0, sizeof(g_eeprom.config.setting.dtmf.revive_code));
|
||||
|
||||
@ -344,7 +344,7 @@ void SETTINGS_read_eeprom(void)
|
||||
memset(&g_eeprom.config.setting.aes_key, 0xff, sizeof(g_eeprom.config.setting.aes_key));
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_KILL_REVIVE
|
||||
#ifndef ENABLE_DTMF_KILL_REVIVE
|
||||
g_eeprom.config.setting.radio_disabled = 0;
|
||||
#endif
|
||||
|
||||
@ -459,7 +459,7 @@ void SETTINGS_save(void)
|
||||
memset(&g_eeprom.config.setting.unused8, 0xff, sizeof(g_eeprom.config.setting.unused8));
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_KILL_REVIVE
|
||||
#ifndef ENABLE_DTMF_KILL_REVIVE
|
||||
g_eeprom.config.setting.radio_disabled = 0;
|
||||
#endif
|
||||
|
||||
|
82
ui/main.c
82
ui/main.c
@ -233,10 +233,15 @@ bool UI_DisplayRSSIBar(const int rssi, const unsigned int glitch, const unsigned
|
||||
return false; // display is in use
|
||||
#endif
|
||||
|
||||
if (g_current_function == FUNCTION_TRANSMIT ||
|
||||
g_current_display_screen != DISPLAY_MAIN ||
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
||||
return false; // display is in use
|
||||
if (
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
#endif
|
||||
g_current_function == FUNCTION_TRANSMIT ||
|
||||
g_current_display_screen != DISPLAY_MAIN)
|
||||
{ // display is in use
|
||||
return false;
|
||||
}
|
||||
|
||||
// clear the line
|
||||
memset(g_frame_buffer[line], 0, LCD_WIDTH);
|
||||
@ -419,8 +424,10 @@ void big_freq(const uint32_t frequency, const unsigned int x, const unsigned int
|
||||
g_reduced_service ||
|
||||
g_current_display_screen != DISPLAY_MAIN ||
|
||||
g_current_function == FUNCTION_POWER_SAVE ||
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
g_dtmf_input_mode ||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
#endif
|
||||
g_eeprom.config.setting.dual_watch != DUAL_WATCH_OFF)
|
||||
{ // don't draw the panadapter
|
||||
return;
|
||||
@ -517,19 +524,22 @@ void UI_DisplayCenterLine(void)
|
||||
{
|
||||
// const bool rx = (g_current_function == FUNCTION_RECEIVE && g_squelch_open) ? true : false;
|
||||
const bool rx = (g_current_function == FUNCTION_RECEIVE) ? true : false;
|
||||
|
||||
#ifdef ENABLE_SINGLE_VFO_CHAN
|
||||
const unsigned int line = (single_vfo >= 0 && !pan_enabled) ? 6 : 3;
|
||||
#else
|
||||
const unsigned int line = 3;
|
||||
#endif
|
||||
char str[22];
|
||||
|
||||
(void)rx;
|
||||
(void)line;
|
||||
(void)str;
|
||||
|
||||
if (g_center_line != CENTER_LINE_NONE ||
|
||||
g_current_display_screen != DISPLAY_MAIN ||
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
||||
if (
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
#endif
|
||||
g_center_line != CENTER_LINE_NONE || g_current_display_screen != DISPLAY_MAIN)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -592,8 +602,14 @@ void UI_DisplayCenterLine(void)
|
||||
const unsigned int len = strlen(g_dtmf_rx_live);
|
||||
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
|
||||
|
||||
if (g_current_display_screen != DISPLAY_MAIN || g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
||||
if (
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
#endif
|
||||
g_current_display_screen != DISPLAY_MAIN)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
g_center_line = CENTER_LINE_DTMF_DEC;
|
||||
|
||||
@ -607,8 +623,14 @@ void UI_DisplayCenterLine(void)
|
||||
const unsigned int len = g_dtmf_rx_index;
|
||||
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
|
||||
|
||||
if (g_current_display_screen != DISPLAY_MAIN || g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
||||
if (
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
#endif
|
||||
g_current_display_screen != DISPLAY_MAIN)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
g_center_line = CENTER_LINE_DTMF_DEC;
|
||||
|
||||
@ -623,8 +645,14 @@ void UI_DisplayCenterLine(void)
|
||||
else
|
||||
if (g_charging_with_type_c)
|
||||
{ // show the battery charge state
|
||||
if (g_current_display_screen != DISPLAY_MAIN || g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
||||
if (
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
#endif
|
||||
g_current_display_screen != DISPLAY_MAIN)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
g_center_line = CENTER_LINE_CHARGE_DATA;
|
||||
|
||||
@ -676,7 +704,7 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
|
||||
unsigned int y = 0;
|
||||
unsigned int x = 0;
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||
if (g_eeprom.config.setting.radio_disabled)
|
||||
{
|
||||
#ifdef ENABLE_SMALL_BOLD
|
||||
@ -962,11 +990,13 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
|
||||
//x += 7 * 7;
|
||||
|
||||
// DTMF decoding symbol
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
str[0] = 0;
|
||||
if (g_vfo_info[vfo_num].channel.dtmf_decoding_enable)
|
||||
strcpy(str, "DTMF");
|
||||
UI_PrintStringSmall(str, LCD_WIDTH - (7 * 4), 0, y);
|
||||
//x += 7 * 5;
|
||||
#endif
|
||||
}
|
||||
|
||||
UI_DisplayCenterLine();
|
||||
@ -1066,6 +1096,7 @@ void UI_DisplayMain(void)
|
||||
|
||||
if (current_vfo_num != vfo_num)
|
||||
{
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE || g_dtmf_is_tx || g_dtmf_input_mode)
|
||||
{ // show DTMF stuff
|
||||
|
||||
@ -1133,6 +1164,27 @@ void UI_DisplayMain(void)
|
||||
g_center_line = CENTER_LINE_IN_USE;
|
||||
continue;
|
||||
}
|
||||
#else
|
||||
if (g_dtmf_is_tx || g_dtmf_input_mode)
|
||||
{ // show DTMF stuff
|
||||
|
||||
str[0] = 0;
|
||||
if (g_dtmf_input_mode)
|
||||
sprintf(str, "DTMF entry");
|
||||
UI_PrintString(str, 2, 0, 0 + (vfo_num * 3), 8);
|
||||
|
||||
str[0] = 0;
|
||||
if (g_dtmf_input_mode)
|
||||
sprintf(str, ">%s", g_dtmf_input_box);
|
||||
str[16] = 0;
|
||||
UI_PrintString(str, 2, 0, 2 + (vfo_num * 3), 8);
|
||||
|
||||
pan_enabled = false;
|
||||
|
||||
g_center_line = CENTER_LINE_IN_USE;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (single_vfo < 0)
|
||||
@ -1513,7 +1565,8 @@ void UI_DisplayMain(void)
|
||||
UI_PrintStringSmall(str, 70, 0, line + 2);
|
||||
|
||||
// show the DTMF decoding symbol
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||
if (g_vfo_info[vfo_num].channel.dtmf_decoding_enable || g_eeprom.config.setting.radio_disabled)
|
||||
UI_PrintStringSmall("DTMF", 78, 0, line + 2);
|
||||
#else
|
||||
@ -1521,6 +1574,7 @@ void UI_DisplayMain(void)
|
||||
UI_PrintStringSmall("DTMF", 78, 0, line + 2);
|
||||
//UI_PrintStringSmallest("DTMF", 78, (line + 2) * 8, false, true);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// show the audio scramble symbol
|
||||
if (g_vfo_info[vfo_num].channel.scrambler > 0 && g_eeprom.config.setting.enable_scrambler)
|
||||
|
97
ui/menu.c
97
ui/menu.c
@ -109,7 +109,9 @@ const t_menu_item g_menu_list[] =
|
||||
#ifdef ENABLE_ALARM
|
||||
{"SOS AL", VOICE_ID_INVALID, MENU_ALARM_MODE }, // was "ALMODE"
|
||||
#endif
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
{"ANI ID", VOICE_ID_ANI_CODE, MENU_ANI_ID },
|
||||
#endif
|
||||
{"UpCODE", VOICE_ID_INVALID, MENU_UP_CODE },
|
||||
{"DnCODE", VOICE_ID_INVALID, MENU_DN_CODE }, // was "DWCODE"
|
||||
#ifdef ENABLE_MDC1200
|
||||
@ -118,10 +120,12 @@ const t_menu_item g_menu_list[] =
|
||||
#endif
|
||||
{"PTT ID", VOICE_ID_INVALID, MENU_PTT_ID },
|
||||
{"D ST", VOICE_ID_INVALID, MENU_DTMF_ST },
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
{"D RSP", VOICE_ID_INVALID, MENU_DTMF_RSP },
|
||||
{"D HOLD", VOICE_ID_INVALID, MENU_DTMF_HOLD },
|
||||
{"D DCD", VOICE_ID_INVALID, MENU_DTMF_DCD },
|
||||
{"D LIST", VOICE_ID_INVALID, MENU_DTMF_LIST },
|
||||
#endif
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
{"D LIVE", VOICE_ID_INVALID, MENU_DTMF_LIVE_DEC }, // live DTMF decoder
|
||||
#endif
|
||||
@ -298,13 +302,15 @@ const char g_sub_menu_mem_disp[4][12] =
|
||||
};
|
||||
#endif
|
||||
|
||||
const char g_sub_menu_dtmf_rsp[4][9] =
|
||||
{
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
const char g_sub_menu_dtmf_rsp[4][9] =
|
||||
{
|
||||
"NONE",
|
||||
"RING",
|
||||
"REPLY",
|
||||
"RNG RPLY"
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
const char g_sub_menu_ptt_id[5][16] =
|
||||
{
|
||||
@ -836,14 +842,26 @@ void UI_DisplayMenu(void)
|
||||
strcat(str, g_sub_menu_off_on[g_sub_menu_selection]);
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
#if defined(ENABLE_DTMF_LIVE_DECODER) && defined(ENABLE_DTMF_CALLING)
|
||||
case MENU_DTMF_DCD:
|
||||
case MENU_DTMF_LIVE_DEC:
|
||||
#endif
|
||||
strcpy(str, "DTMF\nDECODE\n");
|
||||
strcat(str, g_sub_menu_off_on[g_sub_menu_selection]);
|
||||
channel_setting = true;
|
||||
break;
|
||||
#elif defined(ENABLE_DTMF_CALLING)
|
||||
case MENU_DTMF_DCD:
|
||||
strcpy(str, "DTMF\nDECODE\n");
|
||||
strcat(str, g_sub_menu_off_on[g_sub_menu_selection]);
|
||||
channel_setting = true;
|
||||
break;
|
||||
#elif defined(ENABLE_DTMF_LIVE_DECODER)
|
||||
case MENU_DTMF_LIVE_DEC:
|
||||
strcpy(str, "DTMF\nDECODE\n");
|
||||
strcat(str, g_sub_menu_off_on[g_sub_menu_selection]);
|
||||
channel_setting = true;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case MENU_STE:
|
||||
strcpy(str, "SUB TAIL\nELIMIN\n");
|
||||
@ -1028,10 +1046,12 @@ void UI_DisplayMenu(void)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
case MENU_ANI_ID:
|
||||
strcpy(str, "DTMF ID\n");
|
||||
strcat(str, g_eeprom.config.setting.dtmf.ani_id);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case MENU_UP_CODE:
|
||||
strcpy(str, "DTMF BOT\n");
|
||||
@ -1045,6 +1065,12 @@ void UI_DisplayMenu(void)
|
||||
channel_setting = true;
|
||||
break;
|
||||
|
||||
case MENU_PTT_ID:
|
||||
strcpy(str, g_sub_menu_ptt_id[g_sub_menu_selection]);
|
||||
channel_setting = true;
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
case MENU_DTMF_RSP:
|
||||
strcpy(str, "DTMF\nRESP\n");
|
||||
strcat(str, g_sub_menu_dtmf_rsp[g_sub_menu_selection]);
|
||||
@ -1079,6 +1105,27 @@ void UI_DisplayMenu(void)
|
||||
|
||||
break;
|
||||
|
||||
case MENU_DTMF_LIST:
|
||||
{
|
||||
char Contact[17];
|
||||
g_dtmf_is_contact_valid = DTMF_GetContact((int)g_sub_menu_selection - 1, Contact);
|
||||
strcpy(str, "DTMF\n");
|
||||
if (!g_dtmf_is_contact_valid)
|
||||
{
|
||||
strcat(str, "NULL");
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(str + strlen(str), Contact, 8);
|
||||
Contact[11] = 0;
|
||||
memcpy(&g_dtmf_id, Contact + 8, sizeof(g_dtmf_id));
|
||||
sprintf(str + strlen(str), "\nID:%s", Contact + 8);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DTMF_TIMING_SETTINGS
|
||||
case MENU_DTMF_PRE:
|
||||
case MENU_DTMF_1ST_PERSIST:
|
||||
@ -1120,34 +1167,10 @@ void UI_DisplayMenu(void)
|
||||
break;
|
||||
#endif
|
||||
|
||||
case MENU_PTT_ID:
|
||||
strcpy(str, g_sub_menu_ptt_id[g_sub_menu_selection]);
|
||||
channel_setting = true;
|
||||
break;
|
||||
|
||||
case MENU_BAT_TXT:
|
||||
strcpy(str, g_sub_menu_bat_text[g_sub_menu_selection]);
|
||||
break;
|
||||
|
||||
case MENU_DTMF_LIST:
|
||||
{
|
||||
char Contact[17];
|
||||
g_dtmf_is_contact_valid = DTMF_GetContact((int)g_sub_menu_selection - 1, Contact);
|
||||
strcpy(str, "DTMF\n");
|
||||
if (!g_dtmf_is_contact_valid)
|
||||
{
|
||||
strcat(str, "NULL");
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(str + strlen(str), Contact, 8);
|
||||
Contact[11] = 0;
|
||||
memcpy(&g_dtmf_id, Contact + 8, sizeof(g_dtmf_id));
|
||||
sprintf(str + strlen(str), "\nID:%s", Contact + 8);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case MENU_PON_MSG:
|
||||
strcpy(str, g_sub_menu_pwr_on_msg[g_sub_menu_selection]);
|
||||
break;
|
||||
@ -1421,17 +1444,23 @@ void UI_DisplayMenu(void)
|
||||
if (strlen(g_eeprom.config.setting.dtmf.key_down_code) > 8)
|
||||
UI_PrintString(g_eeprom.config.setting.dtmf.key_down_code + 8, sub_menu_x1, sub_menu_x2, 4, 8);
|
||||
|
||||
if (g_menu_cursor == MENU_RX_CTCSS ||
|
||||
if (
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
g_menu_cursor == MENU_DTMF_LIST ||
|
||||
#endif
|
||||
g_menu_cursor == MENU_RX_CTCSS ||
|
||||
g_menu_cursor == MENU_TX_CTCSS ||
|
||||
g_menu_cursor == MENU_RX_CDCSS ||
|
||||
g_menu_cursor == MENU_TX_CDCSS ||
|
||||
g_menu_cursor == MENU_DTMF_LIST)
|
||||
g_menu_cursor == MENU_TX_CDCSS)
|
||||
{
|
||||
if (g_in_sub_menu)
|
||||
{
|
||||
unsigned int Offset;
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
const unsigned int Offset = (g_menu_cursor == MENU_DTMF_LIST) ? 2 : 3;
|
||||
#else
|
||||
const unsigned int Offset = 3;
|
||||
#endif
|
||||
NUMBER_ToDigits(g_sub_menu_selection, str);
|
||||
Offset = (g_menu_cursor == MENU_DTMF_LIST) ? 2 : 3;
|
||||
UI_Displaysmall_digits(Offset, str + (8 - Offset), 105, 0, false);
|
||||
}
|
||||
}
|
||||
|
@ -95,14 +95,18 @@ enum
|
||||
MENU_S_LIST,
|
||||
MENU_SLIST1,
|
||||
MENU_SLIST2,
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
MENU_ANI_ID,
|
||||
#endif
|
||||
MENU_UP_CODE,
|
||||
MENU_DN_CODE,
|
||||
MENU_DTMF_ST,
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
MENU_DTMF_HOLD,
|
||||
MENU_DTMF_LIST,
|
||||
MENU_DTMF_RSP,
|
||||
MENU_DTMF_DCD,
|
||||
#endif
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
MENU_DTMF_LIVE_DEC,
|
||||
#endif
|
||||
@ -200,7 +204,9 @@ extern const char g_sub_menu_mem_disp[4][12];
|
||||
#ifdef ENABLE_ALARM
|
||||
extern const char g_sub_menu_alarm_mode[2][5];
|
||||
#endif
|
||||
extern const char g_sub_menu_dtmf_rsp[4][9];
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
extern const char g_sub_menu_dtmf_rsp[4][9];
|
||||
#endif
|
||||
extern const char g_sub_menu_ptt_id[5][16];
|
||||
#ifdef ENABLE_MDC1200
|
||||
extern const char g_sub_menu_mdc1200_mode[4][5];
|
||||
|
@ -80,7 +80,7 @@ void UI_DisplayStatus(const bool test_display)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||
if (g_eeprom.config.setting.radio_disabled)
|
||||
{
|
||||
memset(line + x, 0xFF, 10);
|
||||
@ -143,7 +143,9 @@ void UI_DisplayStatus(const bool test_display)
|
||||
#endif
|
||||
|
||||
if (g_dual_watch_tick_10ms > dual_watch_delay_toggle_10ms ||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
#endif
|
||||
g_scan_state_dir != SCAN_STATE_DIR_OFF ||
|
||||
g_css_scan_mode != CSS_SCAN_MODE_OFF ||
|
||||
(g_current_function != FUNCTION_FOREGROUND && g_current_function != FUNCTION_POWER_SAVE) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user