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_VOICE := 0
|
||||||
ENABLE_MUTE_RADIO_FOR_VOICE := 0
|
ENABLE_MUTE_RADIO_FOR_VOICE := 0
|
||||||
# Tx on Voice 1.0 kB
|
# Tx on Voice 1.0 kB
|
||||||
ENABLE_VOX := 0
|
ENABLE_VOX := 1
|
||||||
ENABLE_VOX_MORE_SENSITIVE := 1
|
ENABLE_VOX_MORE_SENSITIVE := 1
|
||||||
# Tx Alarm 600 B
|
# Tx Alarm 600 B
|
||||||
ENABLE_ALARM := 0
|
ENABLE_ALARM := 0
|
||||||
@ -40,11 +40,15 @@ ENABLE_MDC1200_SIDE_BEEP := 1
|
|||||||
ENABLE_PWRON_PASSWORD := 0
|
ENABLE_PWRON_PASSWORD := 0
|
||||||
ENABLE_RESET_AES_KEY := 0
|
ENABLE_RESET_AES_KEY := 0
|
||||||
ENABLE_BIG_FREQ := 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_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
|
ENABLE_SHOW_FREQ_IN_CHAN := 1
|
||||||
# smaa bold 580 B
|
# smaa bold 580 B
|
||||||
ENABLE_SMALL_BOLD := 0
|
ENABLE_SMALL_BOLD := 1
|
||||||
# smallest font 2 kB
|
# smallest font 2 kB
|
||||||
ENABLE_SMALLEST_FONT := 0
|
ENABLE_SMALLEST_FONT := 0
|
||||||
# trim trailing 44 B
|
# trim trailing 44 B
|
||||||
@ -60,19 +64,16 @@ ENABLE_TX_POWER_FIX := 1
|
|||||||
ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1
|
ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1
|
||||||
ENABLE_CONTRAST := 0
|
ENABLE_CONTRAST := 0
|
||||||
ENABLE_BOOT_BEEPS := 0
|
ENABLE_BOOT_BEEPS := 0
|
||||||
ENABLE_DTMF_CALL_FLASH_LIGHT := 0
|
|
||||||
ENABLE_FLASH_LIGHT_SOS_TONE := 0
|
ENABLE_FLASH_LIGHT_SOS_TONE := 0
|
||||||
ENABLE_SHOW_CHARGE_LEVEL := 0
|
ENABLE_SHOW_CHARGE_LEVEL := 0
|
||||||
ENABLE_REVERSE_BAT_SYMBOL := 0
|
ENABLE_REVERSE_BAT_SYMBOL := 0
|
||||||
ENABLE_FREQ_SEARCH_LNA := 0
|
ENABLE_FREQ_SEARCH_LNA := 1
|
||||||
ENABLE_FREQ_SEARCH_TIMEOUT := 0
|
ENABLE_FREQ_SEARCH_TIMEOUT := 0
|
||||||
ENABLE_CODE_SEARCH_TIMEOUT := 0
|
ENABLE_CODE_SEARCH_TIMEOUT := 0
|
||||||
# scan ignore list 740 B
|
# scan ignore list 740 B
|
||||||
ENABLE_SCAN_IGNORE_LIST := 0
|
ENABLE_SCAN_IGNORE_LIST := 1
|
||||||
# scan ranges 400 B
|
# scan ranges 400 B
|
||||||
ENABLE_SCAN_RANGES := 0
|
ENABLE_SCAN_RANGES := 1
|
||||||
# Kill and Revive 400 B
|
|
||||||
ENABLE_KILL_REVIVE := 0
|
|
||||||
# AM Fix 800 B
|
# AM Fix 800 B
|
||||||
ENABLE_AM_FIX := 1
|
ENABLE_AM_FIX := 1
|
||||||
ENABLE_AM_FIX_SHOW_DATA := 0
|
ENABLE_AM_FIX_SHOW_DATA := 0
|
||||||
@ -334,6 +335,9 @@ endif
|
|||||||
ifeq ($(ENABLE_BIG_FREQ),1)
|
ifeq ($(ENABLE_BIG_FREQ),1)
|
||||||
CFLAGS += -DENABLE_BIG_FREQ
|
CFLAGS += -DENABLE_BIG_FREQ
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(ENABLE_DTMF_CALLING),1)
|
||||||
|
CFLAGS += -DENABLE_DTMF_CALLING
|
||||||
|
endif
|
||||||
ifeq ($(ENABLE_DTMF_LIVE_DECODER),1)
|
ifeq ($(ENABLE_DTMF_LIVE_DECODER),1)
|
||||||
CFLAGS += -DENABLE_DTMF_LIVE_DECODER
|
CFLAGS += -DENABLE_DTMF_LIVE_DECODER
|
||||||
endif
|
endif
|
||||||
@ -439,8 +443,8 @@ endif
|
|||||||
ifeq ($(ENABLE_SCAN_RANGES),1)
|
ifeq ($(ENABLE_SCAN_RANGES),1)
|
||||||
CFLAGS += -DENABLE_SCAN_RANGES
|
CFLAGS += -DENABLE_SCAN_RANGES
|
||||||
endif
|
endif
|
||||||
ifeq ($(ENABLE_KILL_REVIVE),1)
|
ifeq ($(ENABLE_DTMF_KILL_REVIVE),1)
|
||||||
CFLAGS += -DENABLE_KILL_REVIVE
|
CFLAGS += -DENABLE_DTMF_KILL_REVIVE
|
||||||
endif
|
endif
|
||||||
ifeq ($(ENABLE_FREQ_SEARCH_LNA),1)
|
ifeq ($(ENABLE_FREQ_SEARCH_LNA),1)
|
||||||
CFLAGS += -DENABLE_FREQ_SEARCH_LNA
|
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_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_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_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_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_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_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_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
|
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_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_CONTRAST := 0 add contrast menu
|
||||||
ENABLE_BOOT_BEEPS := 0 gives user audio feedback on volume knob position at boot-up
|
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_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_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)
|
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_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_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_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 := 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_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
|
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;
|
g_monitor_enabled = false;
|
||||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||||
|
|
||||||
DTMF_clear_RX();
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
|
DTMF_clear_RX();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
g_dtmf_rx_live_timeout = 0;
|
g_dtmf_rx_live_timeout = 0;
|
||||||
|
182
app/app.c
182
app/app.c
@ -198,8 +198,10 @@ static void APP_process_new_receive(void)
|
|||||||
if (!g_squelch_open && !g_monitor_enabled)
|
if (!g_squelch_open && !g_monitor_enabled)
|
||||||
{ // squelch is closed
|
{ // squelch is closed
|
||||||
|
|
||||||
if (g_dtmf_rx_index > 0)
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
DTMF_clear_RX();
|
if (g_dtmf_rx_index > 0)
|
||||||
|
DTMF_clear_RX();
|
||||||
|
#endif
|
||||||
|
|
||||||
if (g_current_function != FUNCTION_FOREGROUND)
|
if (g_current_function != FUNCTION_FOREGROUND)
|
||||||
{
|
{
|
||||||
@ -250,10 +252,11 @@ static void APP_process_new_receive(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
if (g_scan_state_dir == SCAN_STATE_DIR_OFF && g_css_scan_mode == CSS_SCAN_MODE_OFF)
|
if (g_scan_state_dir == SCAN_STATE_DIR_OFF && g_css_scan_mode == CSS_SCAN_MODE_OFF)
|
||||||
{ // not scanning
|
{ // 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)
|
if (g_rx_vfo->channel.dtmf_decoding_enable || g_eeprom.config.setting.radio_disabled)
|
||||||
#else
|
#else
|
||||||
if (g_rx_vfo->channel.dtmf_decoding_enable)
|
if (g_rx_vfo->channel.dtmf_decoding_enable)
|
||||||
@ -276,6 +279,7 @@ static void APP_process_new_receive(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
APP_start_listening();
|
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_num;
|
||||||
// const unsigned int chan = g_rx_vfo->channel_save;
|
// 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)
|
if (g_eeprom.config.setting.radio_disabled)
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
if (g_squelch_open)
|
if (g_squelch_open)
|
||||||
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_GREEN, true); // green LED on
|
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;
|
return false;
|
||||||
if (g_ptt_is_pressed)
|
if (g_ptt_is_pressed)
|
||||||
return false;
|
return false;
|
||||||
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
return false;
|
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
if (g_fm_radio_mode)
|
if (g_fm_radio_mode)
|
||||||
return false;
|
return false;
|
||||||
@ -1024,24 +1032,26 @@ void APP_process_radio_interrupts(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_KILL_REVIVE
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
if (g_rx_vfo->channel.dtmf_decoding_enable || g_eeprom.config.setting.radio_disabled)
|
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||||
#else
|
if (g_rx_vfo->channel.dtmf_decoding_enable || g_eeprom.config.setting.radio_disabled)
|
||||||
if (g_rx_vfo->channel.dtmf_decoding_enable)
|
#else
|
||||||
#endif
|
if (g_rx_vfo->channel.dtmf_decoding_enable)
|
||||||
{
|
#endif
|
||||||
if (g_dtmf_rx_index >= (sizeof(g_dtmf_rx) - 1))
|
{
|
||||||
{ // make room
|
if (g_dtmf_rx_index >= (sizeof(g_dtmf_rx) - 1))
|
||||||
memmove(&g_dtmf_rx[0], &g_dtmf_rx[1], sizeof(g_dtmf_rx) - 1);
|
{ // make room
|
||||||
g_dtmf_rx_index--;
|
memmove(&g_dtmf_rx[0], &g_dtmf_rx[1], sizeof(g_dtmf_rx) - 1);
|
||||||
|
g_dtmf_rx_index--;
|
||||||
|
}
|
||||||
|
g_dtmf_rx[g_dtmf_rx_index++] = c;
|
||||||
|
g_dtmf_rx[g_dtmf_rx_index] = 0;
|
||||||
|
g_dtmf_rx_timeout = dtmf_rx_timeout_500ms; // time till we delete it
|
||||||
|
g_dtmf_rx_pending = true;
|
||||||
|
|
||||||
|
DTMF_HandleRequest();
|
||||||
}
|
}
|
||||||
g_dtmf_rx[g_dtmf_rx_index++] = c;
|
#endif
|
||||||
g_dtmf_rx[g_dtmf_rx_index] = 0;
|
|
||||||
g_dtmf_rx_timeout = dtmf_rx_timeout_500ms; // time till we delete it
|
|
||||||
g_dtmf_rx_pending = true;
|
|
||||||
|
|
||||||
DTMF_HandleRequest();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1272,9 +1282,11 @@ void APP_end_tx(void)
|
|||||||
|
|
||||||
g_update_status = true;
|
g_update_status = true;
|
||||||
|
|
||||||
#ifdef ENABLE_KILL_REVIVE
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
if (g_eeprom.config.setting.radio_disabled)
|
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||||
return;
|
if (g_eeprom.config.setting.radio_disabled)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!g_eeprom.config.setting.tx_enable)
|
if (!g_eeprom.config.setting.tx_enable)
|
||||||
@ -1319,9 +1331,11 @@ void APP_process_keys(void)
|
|||||||
|
|
||||||
key_code_t key;
|
key_code_t key;
|
||||||
|
|
||||||
#ifdef ENABLE_KILL_REVIVE
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
if (g_eeprom.config.setting.radio_disabled)
|
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||||
return;
|
if (g_eeprom.config.setting.radio_disabled)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// *****************
|
// *****************
|
||||||
@ -1345,7 +1359,7 @@ void APP_process_keys(void)
|
|||||||
if (g_current_display_screen != DISPLAY_AIRCOPY)
|
if (g_current_display_screen != DISPLAY_AIRCOPY)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_KILL_REVIVE
|
#if defined(ENABLE_DTMF_CALLING) && defined(ENABLE_DTMF_KILL_REVIVE)
|
||||||
if (!g_eeprom.config.setting.radio_disabled)
|
if (!g_eeprom.config.setting.radio_disabled)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@ -1929,7 +1943,9 @@ void APP_process_power_save(void)
|
|||||||
g_scan_state_dir != SCAN_STATE_DIR_OFF ||
|
g_scan_state_dir != SCAN_STATE_DIR_OFF ||
|
||||||
g_css_scan_mode != CSS_SCAN_MODE_OFF ||
|
g_css_scan_mode != CSS_SCAN_MODE_OFF ||
|
||||||
g_current_display_screen != DISPLAY_MAIN ||
|
g_current_display_screen != DISPLAY_MAIN ||
|
||||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
|
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||||
|
#endif
|
||||||
g_flash_light_state == FLASHLIGHT_SOS)
|
g_flash_light_state == FLASHLIGHT_SOS)
|
||||||
{
|
{
|
||||||
power_save = false;
|
power_save = false;
|
||||||
@ -2129,9 +2145,11 @@ void APP_time_slice_500ms(void)
|
|||||||
if (--g_menu_tick_10ms == 0)
|
if (--g_menu_tick_10ms == 0)
|
||||||
exit_menu = (g_current_display_screen == DISPLAY_MENU); // exit menu mode
|
exit_menu = (g_current_display_screen == DISPLAY_MENU); // exit menu mode
|
||||||
|
|
||||||
if (g_dtmf_rx_timeout > 0)
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
if (--g_dtmf_rx_timeout == 0)
|
if (g_dtmf_rx_timeout > 0)
|
||||||
DTMF_clear_RX();
|
if (--g_dtmf_rx_timeout == 0)
|
||||||
|
DTMF_clear_RX();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
if (g_fm_radio_tick_500ms > 0)
|
if (g_fm_radio_tick_500ms > 0)
|
||||||
@ -2350,48 +2368,50 @@ void APP_time_slice_500ms(void)
|
|||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (g_current_function != FUNCTION_TRANSMIT)
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
{
|
if (g_current_function != FUNCTION_TRANSMIT)
|
||||||
if (g_dtmf_decode_ring_tick_500ms > 0)
|
|
||||||
{ // make "ring-ring" sound
|
|
||||||
g_dtmf_decode_ring_tick_500ms--;
|
|
||||||
|
|
||||||
#ifdef ENABLE_DTMF_CALL_FLASH_LIGHT
|
|
||||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); // light on
|
|
||||||
#endif
|
|
||||||
|
|
||||||
AUDIO_PlayBeep(BEEP_880HZ_200MS);
|
|
||||||
|
|
||||||
#ifdef ENABLE_DTMF_CALL_FLASH_LIGHT
|
|
||||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); // light off
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
g_dtmf_decode_ring_tick_500ms = 0;
|
|
||||||
|
|
||||||
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE &&
|
|
||||||
g_current_function != FUNCTION_TRANSMIT &&
|
|
||||||
g_current_function != FUNCTION_RECEIVE)
|
|
||||||
{
|
|
||||||
if (g_dtmf_auto_reset_time_500ms > 0)
|
|
||||||
{
|
{
|
||||||
if (--g_dtmf_auto_reset_time_500ms == 0)
|
if (g_dtmf_decode_ring_tick_500ms > 0)
|
||||||
{
|
{ // make "ring-ring" sound
|
||||||
if (g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED && g_eeprom.config.setting.dtmf.auto_reset_time >= DTMF_HOLD_MAX)
|
g_dtmf_decode_ring_tick_500ms--;
|
||||||
g_dtmf_call_state = DTMF_CALL_STATE_RECEIVED_STAY; // keep message on-screen till a key is pressed
|
|
||||||
else
|
#ifdef ENABLE_DTMF_CALL_FLASH_LIGHT
|
||||||
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); // light on
|
||||||
g_update_display = true;
|
#endif
|
||||||
|
|
||||||
|
AUDIO_PlayBeep(BEEP_880HZ_200MS);
|
||||||
|
|
||||||
|
#ifdef ENABLE_DTMF_CALL_FLASH_LIGHT
|
||||||
|
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); // light off
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
g_dtmf_decode_ring_tick_500ms = 0;
|
||||||
|
|
||||||
// if (g_dtmf_call_state != DTMF_CALL_STATE_RECEIVED_STAY)
|
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE &&
|
||||||
// {
|
g_current_function != FUNCTION_TRANSMIT &&
|
||||||
// g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
g_current_function != FUNCTION_RECEIVE)
|
||||||
// g_update_display = true;
|
{
|
||||||
// }
|
if (g_dtmf_auto_reset_time_500ms > 0)
|
||||||
}
|
{
|
||||||
|
if (--g_dtmf_auto_reset_time_500ms == 0)
|
||||||
|
{
|
||||||
|
if (g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED && g_eeprom.config.setting.dtmf.auto_reset_time >= DTMF_HOLD_MAX)
|
||||||
|
g_dtmf_call_state = DTMF_CALL_STATE_RECEIVED_STAY; // keep message on-screen till a key is pressed
|
||||||
|
else
|
||||||
|
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
||||||
|
g_update_display = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (g_dtmf_call_state != DTMF_CALL_STATE_RECEIVED_STAY)
|
||||||
|
// {
|
||||||
|
// g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
||||||
|
// g_update_display = true;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (g_dtmf_is_tx && g_dtmf_tx_stop_tick_500ms > 0)
|
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
|
#ifdef ENABLE_AIRCOPY
|
||||||
if (g_current_display_screen == DISPLAY_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;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#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;
|
g_menu_tick_10ms = menu_timeout_500ms;
|
||||||
|
|
||||||
// cancel the ringing
|
// cancel the ringing
|
||||||
if (key_pressed && g_dtmf_decode_ring_tick_500ms > 0)
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
g_dtmf_decode_ring_tick_500ms = 0;
|
if (key_pressed && g_dtmf_decode_ring_tick_500ms > 0)
|
||||||
|
g_dtmf_decode_ring_tick_500ms = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
// ********************
|
// ********************
|
||||||
|
|
||||||
@ -3063,10 +3085,12 @@ Skip:
|
|||||||
|
|
||||||
// g_tx_vfo->freq_in_channel = SETTINGS_find_channel(frequency);
|
// g_tx_vfo->freq_in_channel = SETTINGS_find_channel(frequency);
|
||||||
|
|
||||||
g_dtmf_auto_reset_time_500ms = 0;
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
g_dtmf_auto_reset_time_500ms = 0;
|
||||||
g_dtmf_tx_stop_tick_500ms = 0;
|
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
||||||
g_dtmf_is_tx = false;
|
#endif
|
||||||
|
g_dtmf_tx_stop_tick_500ms = 0;
|
||||||
|
g_dtmf_is_tx = false;
|
||||||
|
|
||||||
g_vfo_rssi_bar_level[0] = 0;
|
g_vfo_rssi_bar_level[0] = 0;
|
||||||
g_vfo_rssi_bar_level[1] = 0;
|
g_vfo_rssi_bar_level[1] = 0;
|
||||||
|
562
app/dtmf.c
562
app/dtmf.c
@ -41,38 +41,43 @@ uint8_t g_dtmf_input_box_index;
|
|||||||
bool g_dtmf_input_mode;
|
bool g_dtmf_input_mode;
|
||||||
uint8_t g_dtmf_prev_index;
|
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
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
char g_dtmf_rx_live[20];
|
char g_dtmf_rx_live[20];
|
||||||
uint8_t g_dtmf_rx_live_timeout;
|
uint8_t g_dtmf_rx_live_timeout;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool g_dtmf_is_contact_valid;
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
char g_dtmf_id[4];
|
char g_dtmf_rx[17];
|
||||||
char g_dtmf_caller[4];
|
uint8_t g_dtmf_rx_index;
|
||||||
char g_dtmf_callee[4];
|
uint8_t g_dtmf_rx_timeout;
|
||||||
dtmf_state_t g_dtmf_state;
|
bool g_dtmf_rx_pending;
|
||||||
uint8_t g_dtmf_decode_ring_tick_500ms;
|
|
||||||
uint8_t g_dtmf_chosen_contact;
|
bool g_dtmf_is_contact_valid;
|
||||||
uint8_t g_dtmf_auto_reset_time_500ms;
|
char g_dtmf_id[4];
|
||||||
dtmf_call_state_t g_dtmf_call_state;
|
char g_dtmf_caller[4];
|
||||||
dtmf_reply_state_t g_dtmf_reply_state;
|
char g_dtmf_callee[4];
|
||||||
dtmf_call_mode_t g_dtmf_call_mode;
|
dtmf_state_t g_dtmf_state;
|
||||||
bool g_dtmf_is_tx;
|
uint8_t g_dtmf_decode_ring_tick_500ms;
|
||||||
uint8_t g_dtmf_tx_stop_tick_500ms;
|
uint8_t g_dtmf_chosen_contact;
|
||||||
bool g_dtmf_IsGroupCall;
|
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
|
||||||
|
|
||||||
void DTMF_clear_RX(void)
|
dtmf_reply_state_t g_dtmf_reply_state;
|
||||||
{
|
bool g_dtmf_is_tx;
|
||||||
g_dtmf_rx_timeout = 0;
|
uint8_t g_dtmf_tx_stop_tick_500ms;
|
||||||
g_dtmf_rx_index = 0;
|
|
||||||
g_dtmf_rx_pending = false;
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
memset(g_dtmf_rx, 0, sizeof(g_dtmf_rx));
|
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)
|
bool DTMF_ValidateCodes(char *pCode, const unsigned int size)
|
||||||
{
|
{
|
||||||
@ -96,44 +101,46 @@ bool DTMF_ValidateCodes(char *pCode, const unsigned int size)
|
|||||||
return true;
|
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);
|
int i = -1;
|
||||||
// EEPROM_ReadBuffer(0x1C00 + (Index * 16), pContact, 16);
|
if (Index >= 0 && Index < (int)ARRAY_SIZE(g_eeprom.config.dtmf_contact))
|
||||||
i = (int)pContact[0] - ' ';
|
|
||||||
}
|
|
||||||
return (i < 0 || i >= 95) ? false : true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool DTMF_FindContact(const char *pContact, char *pResult)
|
|
||||||
{
|
|
||||||
char Contact[16];
|
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
for (i = 0; i < MAX_DTMF_CONTACTS; i++)
|
|
||||||
{
|
|
||||||
unsigned int j;
|
|
||||||
|
|
||||||
if (!DTMF_GetContact(i, Contact))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
|
||||||
if (pContact[j] != Contact[j + 8])
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (j == 3)
|
|
||||||
{
|
{
|
||||||
memcpy(pResult, Contact, 8);
|
memcpy(pContact, &g_eeprom.config.dtmf_contact[Index], 16);
|
||||||
pResult[8] = 0;
|
// EEPROM_ReadBuffer(0x1C00 + (Index * 16), pContact, 16);
|
||||||
return true;
|
i = (int)pContact[0] - ' ';
|
||||||
}
|
}
|
||||||
|
return (i < 0 || i >= 95) ? false : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
bool DTMF_FindContact(const char *pContact, char *pResult)
|
||||||
}
|
{
|
||||||
|
char Contact[16];
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
for (i = 0; i < MAX_DTMF_CONTACTS; i++)
|
||||||
|
{
|
||||||
|
unsigned int j;
|
||||||
|
|
||||||
|
if (!DTMF_GetContact(i, Contact))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (j = 0; j < 3; j++)
|
||||||
|
if (pContact[j] != Contact[j + 8])
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (j == 3)
|
||||||
|
{
|
||||||
|
memcpy(pResult, Contact, 8);
|
||||||
|
pResult[8] = 0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
char DTMF_GetCharacter(const unsigned int code)
|
char DTMF_GetCharacter(const unsigned int code)
|
||||||
{
|
{
|
||||||
@ -159,31 +166,33 @@ 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++)
|
|
||||||
{
|
{
|
||||||
if (pMsg[i] != pTemplate[i])
|
unsigned int i;
|
||||||
|
for (i = 0; i < size; i++)
|
||||||
{
|
{
|
||||||
if (!bCheckGroup || pMsg[i] != g_eeprom.config.setting.dtmf.group_call_code)
|
if (pMsg[i] != pTemplate[i])
|
||||||
return false;
|
{
|
||||||
g_dtmf_IsGroupCall = true;
|
if (!bCheckGroup || pMsg[i] != g_eeprom.config.setting.dtmf.group_call_code)
|
||||||
|
return false;
|
||||||
|
g_dtmf_IsGroupCall = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
dtmf_call_mode_t DTMF_CheckGroupCall(const char *pMsg, const unsigned int size)
|
||||||
}
|
{
|
||||||
|
unsigned int i;
|
||||||
dtmf_call_mode_t DTMF_CheckGroupCall(const char *pMsg, const unsigned int size)
|
for (i = 0; i < size; i++)
|
||||||
{
|
if (pMsg[i] == g_eeprom.config.setting.dtmf.group_call_code)
|
||||||
unsigned int i;
|
break;
|
||||||
for (i = 0; i < size; i++)
|
|
||||||
if (pMsg[i] == g_eeprom.config.setting.dtmf.group_call_code)
|
return (i < size) ? DTMF_CALL_MODE_GROUP : DTMF_CALL_MODE_NOT_GROUP;
|
||||||
break;
|
}
|
||||||
|
#endif
|
||||||
return (i < size) ? DTMF_CALL_MODE_GROUP : DTMF_CALL_MODE_NOT_GROUP;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DTMF_clear_input_box(void)
|
void DTMF_clear_input_box(void)
|
||||||
{
|
{
|
||||||
@ -204,236 +213,249 @@ void DTMF_Append(const char code)
|
|||||||
g_dtmf_input_box[g_dtmf_input_box_index++] = code;
|
g_dtmf_input_box[g_dtmf_input_box_index++] = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DTMF_HandleRequest(void)
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
{ // proccess the RX'ed DTMF characters
|
void DTMF_HandleRequest(void)
|
||||||
|
{ // proccess the RX'ed DTMF characters
|
||||||
char String[21];
|
|
||||||
unsigned int Offset;
|
|
||||||
|
|
||||||
if (!g_dtmf_rx_pending)
|
|
||||||
return; // nothing new received
|
|
||||||
|
|
||||||
if (g_scan_state_dir != SCAN_STATE_DIR_OFF || g_css_scan_mode != CSS_SCAN_MODE_OFF)
|
|
||||||
{ // we're busy scanning
|
|
||||||
DTMF_clear_RX();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef ENABLE_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)
|
|
||||||
#endif
|
|
||||||
{ // D-DCD is disabled or we're enabled
|
|
||||||
DTMF_clear_RX();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_dtmf_rx_pending = false;
|
|
||||||
|
|
||||||
#ifdef ENABLE_KILL_REVIVE
|
|
||||||
if (g_dtmf_rx_index >= 9)
|
|
||||||
{ // look for the RADIO DISABLE code
|
|
||||||
|
|
||||||
sprintf(String, "%s%c%s", g_eeprom.config.setting.dtmf.ani_id, g_eeprom.config.setting.dtmf.separate_code, g_eeprom.config.setting.dtmf.kill_code);
|
char String[21];
|
||||||
|
unsigned int Offset;
|
||||||
|
|
||||||
Offset = g_dtmf_rx_index - strlen(String);
|
if (!g_dtmf_rx_pending)
|
||||||
|
return; // nothing new received
|
||||||
|
|
||||||
if (DTMF_CompareMessage(g_dtmf_rx + Offset, String, strlen(String), true))
|
if (g_scan_state_dir != SCAN_STATE_DIR_OFF || g_css_scan_mode != CSS_SCAN_MODE_OFF)
|
||||||
{ // bugger
|
{ // we're busy scanning
|
||||||
|
DTMF_clear_RX();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_eeprom.config.setting.dtmf.permit_remote_kill != 0)
|
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||||
{
|
if (!g_rx_vfo->channel.dtmf_decoding_enable && !g_eeprom.config.setting.radio_disabled)
|
||||||
g_eeprom.config.setting.radio_disabled = true; // :(
|
#else
|
||||||
|
if (!g_rx_vfo->channel.dtmf_decoding_enable)
|
||||||
|
#endif
|
||||||
|
{ // D-DCD is disabled or we're enabled
|
||||||
|
DTMF_clear_RX();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_dtmf_rx_pending = false;
|
||||||
|
|
||||||
|
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||||
|
if (g_dtmf_rx_index >= 9)
|
||||||
|
{ // look for the RADIO DISABLE code
|
||||||
|
|
||||||
|
sprintf(String, "%s%c%s", g_eeprom.config.setting.dtmf.ani_id, g_eeprom.config.setting.dtmf.separate_code, g_eeprom.config.setting.dtmf.kill_code);
|
||||||
|
|
||||||
|
Offset = g_dtmf_rx_index - strlen(String);
|
||||||
|
|
||||||
|
if (DTMF_CompareMessage(g_dtmf_rx + Offset, String, strlen(String), true))
|
||||||
|
{ // bugger
|
||||||
|
|
||||||
|
if (g_eeprom.config.setting.dtmf.permit_remote_kill != 0)
|
||||||
|
{
|
||||||
|
g_eeprom.config.setting.radio_disabled = true; // :(
|
||||||
|
|
||||||
|
DTMF_clear_RX();
|
||||||
|
|
||||||
|
SETTINGS_save();
|
||||||
|
|
||||||
|
g_dtmf_reply_state = DTMF_REPLY_AB;
|
||||||
|
|
||||||
|
#ifdef ENABLE_FMRADIO
|
||||||
|
if (g_fm_radio_mode)
|
||||||
|
{
|
||||||
|
FM_turn_off();
|
||||||
|
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
||||||
|
|
||||||
|
g_update_display = true;
|
||||||
|
g_update_status = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_dtmf_rx_index >= 9)
|
||||||
|
{ // look for the REVIVE code
|
||||||
|
|
||||||
|
sprintf(String, "%s%c%s", g_eeprom.config.setting.dtmf.ani_id, g_eeprom.config.setting.dtmf.separate_code, g_eeprom.config.setting.dtmf.revive_code);
|
||||||
|
|
||||||
|
Offset = g_dtmf_rx_index - strlen(String);
|
||||||
|
|
||||||
|
if (DTMF_CompareMessage(g_dtmf_rx + Offset, String, strlen(String), true))
|
||||||
|
{ // shit, we're back !
|
||||||
|
|
||||||
|
g_eeprom.config.setting.radio_disabled = false;
|
||||||
|
|
||||||
DTMF_clear_RX();
|
DTMF_clear_RX();
|
||||||
|
|
||||||
SETTINGS_save();
|
SETTINGS_save();
|
||||||
|
|
||||||
g_dtmf_reply_state = DTMF_REPLY_AB;
|
g_dtmf_reply_state = DTMF_REPLY_AB;
|
||||||
|
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
||||||
#ifdef ENABLE_FMRADIO
|
|
||||||
if (g_fm_radio_mode)
|
g_update_display = true;
|
||||||
{
|
g_update_status = true;
|
||||||
FM_turn_off();
|
return;
|
||||||
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
|
||||||
|
|
||||||
g_update_display = true;
|
|
||||||
g_update_status = true;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
#endif
|
||||||
|
|
||||||
if (g_dtmf_rx_index >= 9)
|
|
||||||
{ // look for the REVIVE code
|
|
||||||
|
|
||||||
sprintf(String, "%s%c%s", g_eeprom.config.setting.dtmf.ani_id, g_eeprom.config.setting.dtmf.separate_code, g_eeprom.config.setting.dtmf.revive_code);
|
if (g_dtmf_rx_index >= 2)
|
||||||
|
{ // look for ACK reply
|
||||||
|
|
||||||
|
strcpy(String, "AB");
|
||||||
|
|
||||||
Offset = g_dtmf_rx_index - strlen(String);
|
Offset = g_dtmf_rx_index - strlen(String);
|
||||||
|
|
||||||
if (DTMF_CompareMessage(g_dtmf_rx + Offset, String, strlen(String), true))
|
if (DTMF_CompareMessage(g_dtmf_rx + Offset, String, strlen(String), true))
|
||||||
{ // shit, we're back !
|
{ // ends with "AB"
|
||||||
|
|
||||||
g_eeprom.config.setting.radio_disabled = false;
|
if (g_dtmf_reply_state != DTMF_REPLY_NONE) // 1of11
|
||||||
|
// if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT) // 1of11
|
||||||
DTMF_clear_RX();
|
{
|
||||||
|
g_dtmf_state = DTMF_STATE_TX_SUCC;
|
||||||
SETTINGS_save();
|
DTMF_clear_RX();
|
||||||
|
g_update_display = true;
|
||||||
g_dtmf_reply_state = DTMF_REPLY_AB;
|
return;
|
||||||
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
}
|
||||||
|
|
||||||
g_update_display = true;
|
|
||||||
g_update_status = true;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT &&
|
||||||
if (g_dtmf_rx_index >= 2)
|
g_dtmf_call_mode == DTMF_CALL_MODE_NOT_GROUP &&
|
||||||
{ // look for ACK reply
|
g_dtmf_rx_index >= 9)
|
||||||
|
{ // waiting for a reply
|
||||||
strcpy(String, "AB");
|
|
||||||
|
sprintf(String, "%s%c%s", g_dtmf_string, g_eeprom.config.setting.dtmf.separate_code, "AAAAA");
|
||||||
Offset = g_dtmf_rx_index - strlen(String);
|
|
||||||
|
Offset = g_dtmf_rx_index - strlen(String);
|
||||||
if (DTMF_CompareMessage(g_dtmf_rx + Offset, String, strlen(String), true))
|
|
||||||
{ // ends with "AB"
|
if (DTMF_CompareMessage(g_dtmf_rx + Offset, String, strlen(String), false))
|
||||||
|
{ // we got a response
|
||||||
if (g_dtmf_reply_state != DTMF_REPLY_NONE) // 1of11
|
g_dtmf_state = DTMF_STATE_CALL_OUT_RSP;
|
||||||
// if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT) // 1of11
|
|
||||||
{
|
|
||||||
g_dtmf_state = DTMF_STATE_TX_SUCC;
|
|
||||||
DTMF_clear_RX();
|
DTMF_clear_RX();
|
||||||
g_update_display = true;
|
g_update_display = true;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||||
if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT &&
|
if (g_eeprom.config.setting.radio_disabled)
|
||||||
g_dtmf_call_mode == DTMF_CALL_MODE_NOT_GROUP &&
|
return; // we've been disabled
|
||||||
g_dtmf_rx_index >= 9)
|
#endif
|
||||||
{ // waiting for a reply
|
|
||||||
|
if (g_dtmf_rx_index >= 7)
|
||||||
sprintf(String, "%s%c%s", g_dtmf_string, g_eeprom.config.setting.dtmf.separate_code, "AAAAA");
|
{ // see if we're being called
|
||||||
|
|
||||||
Offset = g_dtmf_rx_index - strlen(String);
|
g_dtmf_IsGroupCall = false;
|
||||||
|
|
||||||
if (DTMF_CompareMessage(g_dtmf_rx + Offset, String, strlen(String), false))
|
sprintf(String, "%s%c", g_eeprom.config.setting.dtmf.ani_id, g_eeprom.config.setting.dtmf.separate_code);
|
||||||
{ // we got a response
|
|
||||||
g_dtmf_state = DTMF_STATE_CALL_OUT_RSP;
|
Offset = g_dtmf_rx_index - strlen(String) - 3;
|
||||||
DTMF_clear_RX();
|
|
||||||
g_update_display = true;
|
if (DTMF_CompareMessage(g_dtmf_rx + Offset, String, strlen(String), true))
|
||||||
}
|
{ // it's for us !
|
||||||
}
|
|
||||||
|
g_dtmf_call_state = DTMF_CALL_STATE_RECEIVED;
|
||||||
#ifdef ENABLE_KILL_REVIVE
|
|
||||||
if (g_eeprom.config.setting.radio_disabled)
|
memset(g_dtmf_callee, 0, sizeof(g_dtmf_callee));
|
||||||
return; // we've been disabled
|
memset(g_dtmf_caller, 0, sizeof(g_dtmf_caller));
|
||||||
#endif
|
memcpy(g_dtmf_callee, g_dtmf_rx + Offset + 0, 3);
|
||||||
|
memcpy(g_dtmf_caller, g_dtmf_rx + Offset + 4, 3);
|
||||||
if (g_dtmf_rx_index >= 7)
|
|
||||||
{ // see if we're being called
|
DTMF_clear_RX();
|
||||||
|
|
||||||
g_dtmf_IsGroupCall = false;
|
g_update_display = true;
|
||||||
|
|
||||||
sprintf(String, "%s%c", g_eeprom.config.setting.dtmf.ani_id, g_eeprom.config.setting.dtmf.separate_code);
|
switch (g_eeprom.config.setting.dtmf.decode_response)
|
||||||
|
{
|
||||||
Offset = g_dtmf_rx_index - strlen(String) - 3;
|
case DTMF_DEC_RESPONSE_BOTH:
|
||||||
|
g_dtmf_decode_ring_tick_500ms = dtmf_decode_ring_500ms;
|
||||||
if (DTMF_CompareMessage(g_dtmf_rx + Offset, String, strlen(String), true))
|
|
||||||
{ // it's for us !
|
// Fallthrough
|
||||||
|
|
||||||
g_dtmf_call_state = DTMF_CALL_STATE_RECEIVED;
|
case DTMF_DEC_RESPONSE_REPLY:
|
||||||
|
g_dtmf_reply_state = DTMF_REPLY_AAAAA;
|
||||||
memset(g_dtmf_callee, 0, sizeof(g_dtmf_callee));
|
break;
|
||||||
memset(g_dtmf_caller, 0, sizeof(g_dtmf_caller));
|
case DTMF_DEC_RESPONSE_RING:
|
||||||
memcpy(g_dtmf_callee, g_dtmf_rx + Offset + 0, 3);
|
g_dtmf_decode_ring_tick_500ms = dtmf_decode_ring_500ms;
|
||||||
memcpy(g_dtmf_caller, g_dtmf_rx + Offset + 4, 3);
|
break;
|
||||||
|
default:
|
||||||
DTMF_clear_RX();
|
case DTMF_DEC_RESPONSE_NONE:
|
||||||
|
g_dtmf_decode_ring_tick_500ms = 0;
|
||||||
g_update_display = true;
|
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
||||||
|
break;
|
||||||
switch (g_eeprom.config.setting.dtmf.decode_response)
|
}
|
||||||
{
|
|
||||||
case DTMF_DEC_RESPONSE_BOTH:
|
if (g_dtmf_IsGroupCall)
|
||||||
g_dtmf_decode_ring_tick_500ms = dtmf_decode_ring_500ms;
|
|
||||||
|
|
||||||
// Fallthrough
|
|
||||||
|
|
||||||
case DTMF_DEC_RESPONSE_REPLY:
|
|
||||||
g_dtmf_reply_state = DTMF_REPLY_AAAAA;
|
|
||||||
break;
|
|
||||||
case DTMF_DEC_RESPONSE_RING:
|
|
||||||
g_dtmf_decode_ring_tick_500ms = dtmf_decode_ring_500ms;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
case DTMF_DEC_RESPONSE_NONE:
|
|
||||||
g_dtmf_decode_ring_tick_500ms = 0;
|
|
||||||
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_dtmf_IsGroupCall)
|
|
||||||
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
#endif
|
||||||
|
|
||||||
bool DTMF_Reply(void)
|
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 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;
|
const char *pString = NULL;
|
||||||
char str[23];
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
|
char str[23];
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (g_dtmf_reply_state)
|
switch (g_dtmf_reply_state)
|
||||||
{
|
{
|
||||||
case DTMF_REPLY_ANI:
|
case DTMF_REPLY_STR:
|
||||||
pString = g_dtmf_string;
|
pString = g_dtmf_string;
|
||||||
|
break;
|
||||||
|
|
||||||
if (g_dtmf_call_mode != DTMF_CALL_MODE_DTMF)
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
{ // append our ID code onto the end of the DTMF code to send
|
case DTMF_REPLY_ANI:
|
||||||
sprintf(str, "%s%c%s", g_dtmf_string, g_eeprom.config.setting.dtmf.separate_code, g_eeprom.config.setting.dtmf.ani_id);
|
pString = g_dtmf_string;
|
||||||
|
|
||||||
|
if (g_dtmf_call_mode != DTMF_CALL_MODE_DTMF)
|
||||||
|
{ // append our ID code onto the end of the DTMF code to send
|
||||||
|
sprintf(str, "%s%c%s", g_dtmf_string, g_eeprom.config.setting.dtmf.separate_code, g_eeprom.config.setting.dtmf.ani_id);
|
||||||
|
pString = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||||
|
// UART_printf("dtmf tx reply ani %s\r\n", pString);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DTMF_REPLY_AB:
|
||||||
|
pString = "AB";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DTMF_REPLY_AAAAA:
|
||||||
|
sprintf(str, "%s%c%s", g_eeprom.config.setting.dtmf.ani_id, g_eeprom.config.setting.dtmf.separate_code, "AAAAA");
|
||||||
pString = str;
|
pString = str;
|
||||||
}
|
break;
|
||||||
|
|
||||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
case DTMF_REPLY_NONE:
|
||||||
// UART_printf("dtmf tx reply ani %s\r\n", pString);
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DTMF_REPLY_AB:
|
|
||||||
pString = "AB";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DTMF_REPLY_AAAAA:
|
|
||||||
sprintf(str, "%s%c%s", g_eeprom.config.setting.dtmf.ani_id, g_eeprom.config.setting.dtmf.separate_code, "AAAAA");
|
|
||||||
pString = str;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
case DTMF_REPLY_NONE:
|
|
||||||
|
|
||||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||||
// UART_printf("dtmf tx reply none %s\r\n", g_dtmf_string);
|
// UART_printf("dtmf tx reply none %s\r\n", g_dtmf_string);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
if (
|
||||||
g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_APOLLO ||
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_OFF ||
|
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||||
g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_EOT)
|
#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)
|
||||||
{
|
{
|
||||||
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
||||||
return false;
|
return false;
|
||||||
@ -446,7 +468,7 @@ bool DTMF_Reply(void)
|
|||||||
|
|
||||||
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
||||||
|
|
||||||
if (pString == NULL)
|
if (pString == NULL || strlen(pString) == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (g_eeprom.config.setting.dtmf.side_tone)
|
if (g_eeprom.config.setting.dtmf.side_tone)
|
||||||
|
132
app/dtmf.h
132
app/dtmf.h
@ -20,7 +20,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#define MAX_DTMF_CONTACTS 16
|
#define MAX_DTMF_CONTACTS 16
|
||||||
|
|
||||||
enum { // seconds
|
enum { // seconds
|
||||||
DTMF_HOLD_MIN = 5,
|
DTMF_HOLD_MIN = 5,
|
||||||
@ -34,36 +34,45 @@ enum dtmf_state_e {
|
|||||||
};
|
};
|
||||||
typedef enum dtmf_state_e dtmf_state_t;
|
typedef enum dtmf_state_e dtmf_state_t;
|
||||||
|
|
||||||
enum dtmf_call_state_e {
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
DTMF_CALL_STATE_NONE = 0,
|
enum dtmf_call_state_e {
|
||||||
DTMF_CALL_STATE_CALL_OUT,
|
DTMF_CALL_STATE_NONE = 0,
|
||||||
DTMF_CALL_STATE_RECEIVED,
|
DTMF_CALL_STATE_CALL_OUT,
|
||||||
DTMF_CALL_STATE_RECEIVED_STAY
|
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 {
|
||||||
|
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;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
enum dtmf_decode_response_e {
|
enum dtmf_call_mode_e {
|
||||||
DTMF_DEC_RESPONSE_NONE = 0,
|
DTMF_CALL_MODE_NOT_GROUP = 0,
|
||||||
DTMF_DEC_RESPONSE_RING,
|
DTMF_CALL_MODE_GROUP,
|
||||||
DTMF_DEC_RESPONSE_REPLY,
|
DTMF_CALL_MODE_DTMF
|
||||||
DTMF_DEC_RESPONSE_BOTH
|
};
|
||||||
};
|
typedef enum dtmf_call_mode_e dtmf_call_mode_t;
|
||||||
typedef enum dtmf_decode_response_e dtmf_decode_response_t;
|
#else
|
||||||
|
enum dtmf_reply_state_e {
|
||||||
enum dtmf_reply_state_e {
|
DTMF_REPLY_NONE = 0,
|
||||||
DTMF_REPLY_NONE = 0,
|
DTMF_REPLY_STR
|
||||||
DTMF_REPLY_ANI,
|
};
|
||||||
DTMF_REPLY_AB,
|
typedef enum dtmf_reply_state_e dtmf_reply_state_t;
|
||||||
DTMF_REPLY_AAAAA
|
#endif
|
||||||
};
|
|
||||||
typedef enum dtmf_reply_state_e dtmf_reply_state_t;
|
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
extern char g_dtmf_string[15];
|
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 bool g_dtmf_input_mode;
|
||||||
extern uint8_t g_dtmf_prev_index;
|
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
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
extern char g_dtmf_rx_live[20];
|
extern char g_dtmf_rx_live[20];
|
||||||
extern uint8_t g_dtmf_rx_live_timeout;
|
extern uint8_t g_dtmf_rx_live_timeout;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern bool g_dtmf_is_contact_valid;
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
extern char g_dtmf_id[4];
|
extern char g_dtmf_rx[17];
|
||||||
extern char g_dtmf_caller[4];
|
extern uint8_t g_dtmf_rx_index;
|
||||||
extern char g_dtmf_callee[4];
|
extern uint8_t g_dtmf_rx_timeout;
|
||||||
extern dtmf_state_t g_dtmf_state;
|
extern bool g_dtmf_rx_pending;
|
||||||
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_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);
|
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 bool g_dtmf_is_tx;
|
||||||
|
extern uint8_t g_dtmf_tx_stop_tick_500ms;
|
||||||
|
|
||||||
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
|
void DTMF_clear_RX(void);
|
||||||
|
#endif
|
||||||
bool DTMF_ValidateCodes(char *pCode, const unsigned int size);
|
bool DTMF_ValidateCodes(char *pCode, const unsigned int size);
|
||||||
bool DTMF_GetContact(const int Index, char *pContact);
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
bool DTMF_FindContact(const char *pContact, char *pResult);
|
bool DTMF_GetContact(const int Index, char *pContact);
|
||||||
|
bool DTMF_FindContact(const char *pContact, char *pResult);
|
||||||
|
#endif
|
||||||
char DTMF_GetCharacter(const unsigned int code);
|
char DTMF_GetCharacter(const unsigned int code);
|
||||||
bool DTMF_CompareMessage(const char *pDTMF, const char *pTemplate, const unsigned int size, const bool flag);
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
dtmf_call_mode_t DTMF_CheckGroupCall(const char *pDTMF, const unsigned int size);
|
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_clear_input_box(void);
|
||||||
void DTMF_Append(const char vode);
|
void DTMF_Append(const char vode);
|
||||||
void DTMF_HandleRequest(void);
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
|
void DTMF_HandleRequest(void);
|
||||||
|
#endif
|
||||||
bool DTMF_Reply(void);
|
bool DTMF_Reply(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -214,26 +214,32 @@ void GENERIC_Key_PTT(bool key_pressed)
|
|||||||
g_dtmf_input_box[g_dtmf_input_box_index] = 0; // NULL term the string
|
g_dtmf_input_box[g_dtmf_input_box_index] = 0; // NULL term the string
|
||||||
|
|
||||||
// append our DTMF ID to the inputted DTMF code -
|
// append our DTMF ID to the inputted DTMF code -
|
||||||
#if 0
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
// QS
|
#if 0
|
||||||
if (g_dtmf_input_box_index == 3)
|
// QS
|
||||||
g_dtmf_call_mode = DTMF_CheckGroupCall(g_dtmf_input_box, 3);
|
if (g_dtmf_input_box_index == 3)
|
||||||
else
|
g_dtmf_call_mode = DTMF_CheckGroupCall(g_dtmf_input_box, 3);
|
||||||
g_dtmf_call_mode = DTMF_CALL_MODE_DTMF;
|
else
|
||||||
#else
|
g_dtmf_call_mode = DTMF_CALL_MODE_DTMF;
|
||||||
// 1of11
|
#else
|
||||||
if (g_dtmf_input_box_index == 3 && g_dtmf_input_box[0] != '*' && g_dtmf_input_box[0] != '#')
|
// 1of11
|
||||||
g_dtmf_call_mode = DTMF_CheckGroupCall(g_dtmf_input_box, 3);
|
if (g_dtmf_input_box_index == 3 && g_dtmf_input_box[0] != '*' && g_dtmf_input_box[0] != '#')
|
||||||
else
|
g_dtmf_call_mode = DTMF_CheckGroupCall(g_dtmf_input_box, 3);
|
||||||
g_dtmf_call_mode = DTMF_CALL_MODE_DTMF;
|
else
|
||||||
|
g_dtmf_call_mode = DTMF_CALL_MODE_DTMF;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// remember the DTMF string
|
// remember the DTMF string
|
||||||
g_dtmf_prev_index = g_dtmf_input_box_index;
|
g_dtmf_prev_index = g_dtmf_input_box_index;
|
||||||
strcpy(g_dtmf_string, g_dtmf_input_box);
|
strcpy(g_dtmf_string, g_dtmf_input_box);
|
||||||
|
|
||||||
g_dtmf_reply_state = DTMF_REPLY_ANI;
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
g_dtmf_state = DTMF_STATE_0;
|
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)
|
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||||
// UART_printf("generic ptt tx %s\r\n", g_dtmf_string);
|
// UART_printf("generic ptt tx %s\r\n", g_dtmf_string);
|
||||||
|
14
app/main.c
14
app/main.c
@ -703,12 +703,14 @@ void MAIN_Key_EXIT(bool key_pressed, bool key_held)
|
|||||||
|
|
||||||
g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
||||||
|
|
||||||
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE && g_current_function != FUNCTION_TRANSMIT)
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
{ // clear CALL mode being displayed
|
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE && g_current_function != FUNCTION_TRANSMIT)
|
||||||
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
{ // clear CALL mode being displayed
|
||||||
g_update_display = true;
|
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
||||||
return;
|
g_update_display = true;
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
if (!g_fm_radio_mode)
|
if (!g_fm_radio_mode)
|
||||||
|
254
app/menu.c
254
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_S_ADD2:
|
||||||
case MENU_STE:
|
case MENU_STE:
|
||||||
case MENU_DTMF_ST:
|
case MENU_DTMF_ST:
|
||||||
case MENU_DTMF_DCD:
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
|
case MENU_DTMF_DCD:
|
||||||
|
#endif
|
||||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
case MENU_DTMF_LIVE_DEC:
|
case MENU_DTMF_LIVE_DEC:
|
||||||
#endif
|
#endif
|
||||||
@ -322,11 +324,6 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
|||||||
*pMax = 2;
|
*pMax = 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_DTMF_RSP:
|
|
||||||
*pMin = 0;
|
|
||||||
*pMax = ARRAY_SIZE(g_sub_menu_dtmf_rsp) - 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
#ifdef ENABLE_MDC1200
|
#ifdef ENABLE_MDC1200
|
||||||
case MENU_MDC1200_MODE:
|
case MENU_MDC1200_MODE:
|
||||||
*pMin = 0;
|
*pMin = 0;
|
||||||
@ -344,16 +341,28 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
|||||||
*pMax = ARRAY_SIZE(g_sub_menu_ptt_id) - 1;
|
*pMax = ARRAY_SIZE(g_sub_menu_ptt_id) - 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
|
case MENU_DTMF_RSP:
|
||||||
|
*pMin = 0;
|
||||||
|
*pMax = ARRAY_SIZE(g_sub_menu_dtmf_rsp) - 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MENU_DTMF_HOLD:
|
||||||
|
*pMin = DTMF_HOLD_MIN;
|
||||||
|
*pMax = DTMF_HOLD_MAX;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MENU_DTMF_LIST:
|
||||||
|
*pMin = 1;
|
||||||
|
*pMax = 16;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case MENU_BAT_TXT:
|
case MENU_BAT_TXT:
|
||||||
*pMin = 0;
|
*pMin = 0;
|
||||||
*pMax = ARRAY_SIZE(g_sub_menu_bat_text) - 1;
|
*pMax = ARRAY_SIZE(g_sub_menu_bat_text) - 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_DTMF_HOLD:
|
|
||||||
*pMin = DTMF_HOLD_MIN;
|
|
||||||
*pMax = DTMF_HOLD_MAX;
|
|
||||||
break;
|
|
||||||
|
|
||||||
#ifdef ENABLE_DTMF_TIMING_SETTINGS
|
#ifdef ENABLE_DTMF_TIMING_SETTINGS
|
||||||
case MENU_DTMF_PRE:
|
case MENU_DTMF_PRE:
|
||||||
*pMin = 3;
|
*pMin = 3;
|
||||||
@ -369,11 +378,6 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case MENU_DTMF_LIST:
|
|
||||||
*pMin = 1;
|
|
||||||
*pMax = 16;
|
|
||||||
break;
|
|
||||||
|
|
||||||
#ifdef ENABLE_TX_POWER_CAL_MENU
|
#ifdef ENABLE_TX_POWER_CAL_MENU
|
||||||
case MENU_TX_CALI:
|
case MENU_TX_CALI:
|
||||||
*pMin = 0;
|
*pMin = 0;
|
||||||
@ -741,13 +745,33 @@ void MENU_AcceptSetting(void)
|
|||||||
g_eeprom.config.setting.dtmf.side_tone = g_sub_menu_selection;
|
g_eeprom.config.setting.dtmf.side_tone = g_sub_menu_selection;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_DTMF_RSP:
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
g_eeprom.config.setting.dtmf.decode_response = g_sub_menu_selection;
|
case MENU_DTMF_RSP:
|
||||||
break;
|
g_eeprom.config.setting.dtmf.decode_response = g_sub_menu_selection;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MENU_DTMF_HOLD:
|
||||||
|
g_eeprom.config.setting.dtmf.auto_reset_time = g_sub_menu_selection;
|
||||||
|
break;
|
||||||
|
|
||||||
case MENU_DTMF_HOLD:
|
case MENU_DTMF_DCD:
|
||||||
g_eeprom.config.setting.dtmf.auto_reset_time = g_sub_menu_selection;
|
g_tx_vfo->channel.dtmf_decoding_enable = g_sub_menu_selection;
|
||||||
break;
|
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
|
#ifdef ENABLE_DTMF_TIMING_SETTINGS
|
||||||
case MENU_DTMF_PRE:
|
case MENU_DTMF_PRE:
|
||||||
@ -798,12 +822,6 @@ void MENU_AcceptSetting(void)
|
|||||||
g_eeprom.config.setting.battery_text = g_sub_menu_selection;
|
g_eeprom.config.setting.battery_text = g_sub_menu_selection;
|
||||||
break;
|
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
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
case MENU_DTMF_LIVE_DEC:
|
case MENU_DTMF_LIVE_DEC:
|
||||||
g_eeprom.config.setting.dtmf_live_decoder = g_sub_menu_selection;
|
g_eeprom.config.setting.dtmf_live_decoder = g_sub_menu_selection;
|
||||||
@ -816,18 +834,6 @@ void MENU_AcceptSetting(void)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#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:
|
case MENU_PON_MSG:
|
||||||
g_eeprom.config.setting.power_on_display_mode = g_sub_menu_selection;
|
g_eeprom.config.setting.power_on_display_mode = g_sub_menu_selection;
|
||||||
break;
|
break;
|
||||||
@ -871,21 +877,21 @@ void MENU_AcceptSetting(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef ENABLE_SIDE_BUTT_MENU
|
#ifdef ENABLE_SIDE_BUTT_MENU
|
||||||
case MENU_SIDE1_SHORT:
|
case MENU_SIDE1_SHORT:
|
||||||
g_eeprom.config.setting.key1_short = g_sub_menu_selection;
|
g_eeprom.config.setting.key1_short = g_sub_menu_selection;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_SIDE1_LONG:
|
case MENU_SIDE1_LONG:
|
||||||
g_eeprom.config.setting.key1_long = g_sub_menu_selection;
|
g_eeprom.config.setting.key1_long = g_sub_menu_selection;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_SIDE2_SHORT:
|
case MENU_SIDE2_SHORT:
|
||||||
g_eeprom.config.setting.key2_short = g_sub_menu_selection;
|
g_eeprom.config.setting.key2_short = g_sub_menu_selection;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_SIDE2_LONG:
|
case MENU_SIDE2_LONG:
|
||||||
g_eeprom.config.setting.key2_long = g_sub_menu_selection;
|
g_eeprom.config.setting.key2_long = g_sub_menu_selection;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case MENU_RESET:
|
case MENU_RESET:
|
||||||
@ -1190,9 +1196,9 @@ void MENU_ShowCurrentSetting(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef ENABLE_KEYLOCK
|
#ifdef ENABLE_KEYLOCK
|
||||||
case MENU_AUTO_KEY_LOCK:
|
case MENU_AUTO_KEY_LOCK:
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.auto_key_lock;
|
g_sub_menu_selection = g_eeprom.config.setting.auto_key_lock;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_SCAN_RANGES
|
#ifdef ENABLE_SCAN_RANGES
|
||||||
@ -1257,47 +1263,57 @@ void MENU_ShowCurrentSetting(void)
|
|||||||
g_sub_menu_selection = RADIO_FindNextChannel(0, 1, true, 1);
|
g_sub_menu_selection = RADIO_FindNextChannel(0, 1, true, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef ENABLE_ALARM
|
#ifdef ENABLE_ALARM
|
||||||
case MENU_ALARM_MODE:
|
case MENU_ALARM_MODE:
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.alarm_mode;
|
g_sub_menu_selection = g_eeprom.config.setting.alarm_mode;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case MENU_DTMF_ST:
|
case MENU_DTMF_ST:
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.dtmf.side_tone;
|
g_sub_menu_selection = g_eeprom.config.setting.dtmf.side_tone;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_DTMF_RSP:
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.dtmf.decode_response;
|
case MENU_DTMF_RSP:
|
||||||
break;
|
g_sub_menu_selection = g_eeprom.config.setting.dtmf.decode_response;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MENU_DTMF_HOLD:
|
||||||
|
g_sub_menu_selection = g_eeprom.config.setting.dtmf.auto_reset_time;
|
||||||
|
|
||||||
|
if (g_sub_menu_selection <= DTMF_HOLD_MIN)
|
||||||
|
g_sub_menu_selection = DTMF_HOLD_MIN;
|
||||||
|
else
|
||||||
|
if (g_sub_menu_selection <= 10)
|
||||||
|
g_sub_menu_selection = 10;
|
||||||
|
else
|
||||||
|
if (g_sub_menu_selection <= 20)
|
||||||
|
g_sub_menu_selection = 20;
|
||||||
|
else
|
||||||
|
if (g_sub_menu_selection <= 30)
|
||||||
|
g_sub_menu_selection = 30;
|
||||||
|
else
|
||||||
|
if (g_sub_menu_selection <= 40)
|
||||||
|
g_sub_menu_selection = 40;
|
||||||
|
else
|
||||||
|
if (g_sub_menu_selection <= 50)
|
||||||
|
g_sub_menu_selection = 50;
|
||||||
|
else
|
||||||
|
if (g_sub_menu_selection < DTMF_HOLD_MAX)
|
||||||
|
g_sub_menu_selection = 50;
|
||||||
|
else
|
||||||
|
g_sub_menu_selection = DTMF_HOLD_MAX;
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case MENU_DTMF_HOLD:
|
case MENU_DTMF_DCD:
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.dtmf.auto_reset_time;
|
g_sub_menu_selection = g_tx_vfo->channel.dtmf_decoding_enable;
|
||||||
|
break;
|
||||||
|
|
||||||
if (g_sub_menu_selection <= DTMF_HOLD_MIN)
|
case MENU_DTMF_LIST:
|
||||||
g_sub_menu_selection = DTMF_HOLD_MIN;
|
g_sub_menu_selection = g_dtmf_chosen_contact + 1;
|
||||||
else
|
break;
|
||||||
if (g_sub_menu_selection <= 10)
|
#endif
|
||||||
g_sub_menu_selection = 10;
|
|
||||||
else
|
|
||||||
if (g_sub_menu_selection <= 20)
|
|
||||||
g_sub_menu_selection = 20;
|
|
||||||
else
|
|
||||||
if (g_sub_menu_selection <= 30)
|
|
||||||
g_sub_menu_selection = 30;
|
|
||||||
else
|
|
||||||
if (g_sub_menu_selection <= 40)
|
|
||||||
g_sub_menu_selection = 40;
|
|
||||||
else
|
|
||||||
if (g_sub_menu_selection <= 50)
|
|
||||||
g_sub_menu_selection = 50;
|
|
||||||
else
|
|
||||||
if (g_sub_menu_selection < DTMF_HOLD_MAX)
|
|
||||||
g_sub_menu_selection = 50;
|
|
||||||
else
|
|
||||||
g_sub_menu_selection = DTMF_HOLD_MAX;
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
#ifdef ENABLE_DTMF_TIMING_SETTINGS
|
#ifdef ENABLE_DTMF_TIMING_SETTINGS
|
||||||
case MENU_DTMF_PRE:
|
case MENU_DTMF_PRE:
|
||||||
@ -1339,14 +1355,6 @@ void MENU_ShowCurrentSetting(void)
|
|||||||
g_sub_menu_selection = g_eeprom.config.setting.battery_text;
|
g_sub_menu_selection = g_eeprom.config.setting.battery_text;
|
||||||
return;
|
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
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
case MENU_DTMF_LIVE_DEC:
|
case MENU_DTMF_LIVE_DEC:
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.dtmf_live_decoder;
|
g_sub_menu_selection = g_eeprom.config.setting.dtmf_live_decoder;
|
||||||
@ -1365,49 +1373,49 @@ void MENU_ShowCurrentSetting(void)
|
|||||||
g_sub_menu_selection = g_tx_vfo->channel.mod_mode;
|
g_sub_menu_selection = g_tx_vfo->channel.mod_mode;
|
||||||
break;
|
break;
|
||||||
/*
|
/*
|
||||||
#ifdef ENABLE_AM_FIX
|
#ifdef ENABLE_AM_FIX
|
||||||
case MENU_AM_FIX:
|
case MENU_AM_FIX:
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.am_fix;
|
g_sub_menu_selection = g_eeprom.config.setting.am_fix;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
*/
|
*/
|
||||||
#ifdef ENABLE_AM_FIX_TEST1
|
#ifdef ENABLE_AM_FIX_TEST1
|
||||||
case MENU_AM_FIX_TEST1:
|
case MENU_AM_FIX_TEST1:
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.am_fix_test1;
|
g_sub_menu_selection = g_eeprom.config.setting.am_fix_test1;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
case MENU_NOAA_SCAN:
|
case MENU_NOAA_SCAN:
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.noaa_auto_scan;
|
g_sub_menu_selection = g_eeprom.config.setting.noaa_auto_scan;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case MENU_MEM_DEL:
|
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);
|
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);
|
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;
|
break;
|
||||||
|
|
||||||
#ifdef ENABLE_SIDE_BUTT_MENU
|
#ifdef ENABLE_SIDE_BUTT_MENU
|
||||||
case MENU_SIDE1_SHORT:
|
case MENU_SIDE1_SHORT:
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.key1_short;
|
g_sub_menu_selection = g_eeprom.config.setting.key1_short;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_SIDE1_LONG:
|
case MENU_SIDE1_LONG:
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.key1_long;
|
g_sub_menu_selection = g_eeprom.config.setting.key1_long;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_SIDE2_SHORT:
|
case MENU_SIDE2_SHORT:
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.key2_short;
|
g_sub_menu_selection = g_eeprom.config.setting.key2_short;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_SIDE2_LONG:
|
case MENU_SIDE2_LONG:
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.key2_long;
|
g_sub_menu_selection = g_eeprom.config.setting.key2_long;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case MENU_350_TX:
|
case MENU_350_TX:
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.enable_tx_350;
|
g_sub_menu_selection = g_eeprom.config.setting.enable_tx_350;
|
||||||
|
@ -650,7 +650,9 @@ void SEARCH_Start(void)
|
|||||||
BK4819_EnableFrequencyScan();
|
BK4819_EnableFrequencyScan();
|
||||||
}
|
}
|
||||||
|
|
||||||
DTMF_clear_RX();
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
|
DTMF_clear_RX();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_VOX
|
#ifdef ENABLE_VOX
|
||||||
g_vox_lost = false;
|
g_vox_lost = false;
|
||||||
|
@ -352,7 +352,7 @@ static void cmd_051D(const uint8_t *pBuffer)
|
|||||||
memset(data, 0xff, 8); // wipe the AES key
|
memset(data, 0xff, 8); // wipe the AES key
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#ifndef ENABLE_KILL_REVIVE
|
//#ifndef ENABLE_DTMF_KILL_REVIVE
|
||||||
if (Offset == 0x0F40)
|
if (Offset == 0x0F40)
|
||||||
{ // killed flag is here
|
{ // killed flag is here
|
||||||
data[2] = false; // remove it
|
data[2] = false; // remove it
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
76
functions.c
76
functions.c
@ -56,7 +56,9 @@ void FUNCTION_Init(void)
|
|||||||
else
|
else
|
||||||
g_current_code_type = CODE_TYPE_CONTINUOUS_TONE;
|
g_current_code_type = CODE_TYPE_CONTINUOUS_TONE;
|
||||||
|
|
||||||
DTMF_clear_RX();
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
|
DTMF_clear_RX();
|
||||||
|
#endif
|
||||||
|
|
||||||
g_cxcss_tail_found = false;
|
g_cxcss_tail_found = false;
|
||||||
g_cdcss_lost = 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;
|
g_fm_restore_tick_10ms = g_eeprom.config.setting.scan_hold_time * 50;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT ||
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED ||
|
if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT ||
|
||||||
g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED_STAY)
|
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;
|
{
|
||||||
}
|
g_dtmf_auto_reset_time_500ms = g_eeprom.config.setting.dtmf.auto_reset_time * 2;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -213,7 +217,9 @@ void FUNCTION_Select(function_type_t Function)
|
|||||||
BK4819_DisableDTMF();
|
BK4819_DisableDTMF();
|
||||||
|
|
||||||
// clear the DTMF RX buffer
|
// clear the DTMF RX buffer
|
||||||
DTMF_clear_RX();
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
|
DTMF_clear_RX();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
// clear the DTMF RX live decoder buffer
|
// clear the DTMF RX live decoder buffer
|
||||||
@ -262,35 +268,37 @@ void FUNCTION_Select(function_type_t Function)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (!DTMF_Reply())
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
{
|
if (!DTMF_Reply())
|
||||||
#ifdef ENABLE_MDC1200
|
|
||||||
if (g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_BOT || g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_BOTH)
|
|
||||||
{
|
|
||||||
#ifdef ENABLE_MDC1200_SIDE_BEEP
|
|
||||||
// BK4819_start_tone(880, 10, true, true);
|
|
||||||
// SYSTEM_DelayMs(120);
|
|
||||||
// BK4819_stop_tones(true);
|
|
||||||
#endif
|
|
||||||
SYSTEM_DelayMs(30);
|
|
||||||
|
|
||||||
BK4819_send_MDC1200(MDC1200_OP_CODE_PTT_ID, 0x80, g_eeprom.config.setting.mdc1200_id, true);
|
|
||||||
|
|
||||||
#ifdef ENABLE_MDC1200_SIDE_BEEP
|
|
||||||
BK4819_start_tone(880, 10, true, true);
|
|
||||||
SYSTEM_DelayMs(120);
|
|
||||||
BK4819_stop_tones(true);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
if (g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_APOLLO)
|
|
||||||
{
|
{
|
||||||
BK4819_start_tone(APOLLO_TONE1_HZ, 28, true, false);
|
#ifdef ENABLE_MDC1200
|
||||||
SYSTEM_DelayMs(APOLLO_TONE_MS);
|
if (g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_BOT || g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_BOTH)
|
||||||
BK4819_stop_tones(true);
|
{
|
||||||
|
#ifdef ENABLE_MDC1200_SIDE_BEEP
|
||||||
|
// BK4819_start_tone(880, 10, true, true);
|
||||||
|
// SYSTEM_DelayMs(120);
|
||||||
|
// BK4819_stop_tones(true);
|
||||||
|
#endif
|
||||||
|
SYSTEM_DelayMs(30);
|
||||||
|
|
||||||
|
BK4819_send_MDC1200(MDC1200_OP_CODE_PTT_ID, 0x80, g_eeprom.config.setting.mdc1200_id, true);
|
||||||
|
|
||||||
|
#ifdef ENABLE_MDC1200_SIDE_BEEP
|
||||||
|
BK4819_start_tone(880, 10, true, true);
|
||||||
|
SYSTEM_DelayMs(120);
|
||||||
|
BK4819_stop_tones(true);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
if (g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_APOLLO)
|
||||||
|
{
|
||||||
|
BK4819_start_tone(APOLLO_TONE1_HZ, 28, true, false);
|
||||||
|
SYSTEM_DelayMs(APOLLO_TONE_MS);
|
||||||
|
BK4819_stop_tones(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (g_eeprom.config.setting.enable_scrambler)
|
if (g_eeprom.config.setting.enable_scrambler)
|
||||||
BK4819_set_scrambler(g_current_vfo->channel.scrambler);
|
BK4819_set_scrambler(g_current_vfo->channel.scrambler);
|
||||||
|
@ -142,7 +142,9 @@ void PAN_process_10ms(void)
|
|||||||
g_current_display_screen == DISPLAY_SEARCH ||
|
g_current_display_screen == DISPLAY_SEARCH ||
|
||||||
g_css_scan_mode != CSS_SCAN_MODE_OFF ||
|
g_css_scan_mode != CSS_SCAN_MODE_OFF ||
|
||||||
g_scan_state_dir != SCAN_STATE_DIR_OFF ||
|
g_scan_state_dir != SCAN_STATE_DIR_OFF ||
|
||||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
|
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||||
|
#endif
|
||||||
g_eeprom.config.setting.dual_watch != DUAL_WATCH_OFF)
|
g_eeprom.config.setting.dual_watch != DUAL_WATCH_OFF)
|
||||||
{
|
{
|
||||||
if (g_panadapter_enabled)
|
if (g_panadapter_enabled)
|
||||||
|
38
radio.c
38
radio.c
@ -1167,24 +1167,29 @@ void RADIO_PrepareTX(void)
|
|||||||
// ******************************
|
// ******************************
|
||||||
// TX is allowed
|
// TX is allowed
|
||||||
|
|
||||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
#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);
|
// UART_printf("radio prepare tx %u %s\r\n", g_dtmf_reply_state, g_dtmf_string);
|
||||||
#endif
|
#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)
|
|
||||||
{
|
{
|
||||||
g_dtmf_is_tx = true;
|
if (g_dtmf_call_mode == DTMF_CALL_MODE_DTMF)
|
||||||
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
{
|
||||||
g_dtmf_tx_stop_tick_500ms = dtmf_txstop_500ms;
|
g_dtmf_is_tx = true;
|
||||||
|
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
||||||
|
g_dtmf_tx_stop_tick_500ms = dtmf_txstop_500ms;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_dtmf_call_state = DTMF_CALL_STATE_CALL_OUT;
|
||||||
|
g_dtmf_is_tx = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
#else
|
||||||
{
|
if (g_dtmf_reply_state == DTMF_REPLY_STR)
|
||||||
g_dtmf_call_state = DTMF_CALL_STATE_CALL_OUT;
|
g_dtmf_is_tx = false;
|
||||||
g_dtmf_is_tx = false;
|
#endif
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FUNCTION_Select(FUNCTION_TRANSMIT);
|
FUNCTION_Select(FUNCTION_TRANSMIT);
|
||||||
}
|
}
|
||||||
@ -1233,7 +1238,10 @@ void RADIO_tx_eot(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#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))
|
(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
|
{ // end-of-tx
|
||||||
if (g_eeprom.config.setting.dtmf.side_tone)
|
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_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;
|
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
|
#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;
|
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
|
#else
|
||||||
g_eeprom.config.setting.dtmf.permit_remote_kill = 0;
|
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");
|
strcpy(g_eeprom.config.setting.dtmf.ani_id, "123");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_KILL_REVIVE
|
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||||
// 0EE8..0EEF
|
// 0EE8..0EEF
|
||||||
if (!DTMF_ValidateCodes(g_eeprom.config.setting.dtmf.kill_code, sizeof(g_eeprom.config.setting.dtmf.kill_code)))
|
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
|
// 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.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;
|
// 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;
|
g_eeprom.config.setting.radio_disabled = (g_eeprom.config.setting.radio_disabled < 2) ? g_eeprom.config.setting.radio_disabled : 0;
|
||||||
#else
|
#else
|
||||||
g_eeprom.config.setting.radio_disabled = 0;
|
g_eeprom.config.setting.radio_disabled = 0;
|
||||||
@ -332,7 +332,7 @@ void SETTINGS_read_eeprom(void)
|
|||||||
|
|
||||||
#else
|
#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.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));
|
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));
|
memset(&g_eeprom.config.setting.aes_key, 0xff, sizeof(g_eeprom.config.setting.aes_key));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ENABLE_KILL_REVIVE
|
#ifndef ENABLE_DTMF_KILL_REVIVE
|
||||||
g_eeprom.config.setting.radio_disabled = 0;
|
g_eeprom.config.setting.radio_disabled = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -459,7 +459,7 @@ void SETTINGS_save(void)
|
|||||||
memset(&g_eeprom.config.setting.unused8, 0xff, sizeof(g_eeprom.config.setting.unused8));
|
memset(&g_eeprom.config.setting.unused8, 0xff, sizeof(g_eeprom.config.setting.unused8));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ENABLE_KILL_REVIVE
|
#ifndef ENABLE_DTMF_KILL_REVIVE
|
||||||
g_eeprom.config.setting.radio_disabled = 0;
|
g_eeprom.config.setting.radio_disabled = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
220
ui/main.c
220
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
|
return false; // display is in use
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (g_current_function == FUNCTION_TRANSMIT ||
|
if (
|
||||||
g_current_display_screen != DISPLAY_MAIN ||
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||||
return false; // display is in use
|
#endif
|
||||||
|
g_current_function == FUNCTION_TRANSMIT ||
|
||||||
|
g_current_display_screen != DISPLAY_MAIN)
|
||||||
|
{ // display is in use
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// clear the line
|
// clear the line
|
||||||
memset(g_frame_buffer[line], 0, LCD_WIDTH);
|
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_reduced_service ||
|
||||||
g_current_display_screen != DISPLAY_MAIN ||
|
g_current_display_screen != DISPLAY_MAIN ||
|
||||||
g_current_function == FUNCTION_POWER_SAVE ||
|
g_current_function == FUNCTION_POWER_SAVE ||
|
||||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
g_dtmf_input_mode ||
|
||||||
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)
|
g_eeprom.config.setting.dual_watch != DUAL_WATCH_OFF)
|
||||||
{ // don't draw the panadapter
|
{ // don't draw the panadapter
|
||||||
return;
|
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 && g_squelch_open) ? true : false;
|
||||||
const bool rx = (g_current_function == FUNCTION_RECEIVE) ? true : false;
|
const bool rx = (g_current_function == FUNCTION_RECEIVE) ? true : false;
|
||||||
|
|
||||||
#ifdef ENABLE_SINGLE_VFO_CHAN
|
#ifdef ENABLE_SINGLE_VFO_CHAN
|
||||||
const unsigned int line = (single_vfo >= 0 && !pan_enabled) ? 6 : 3;
|
const unsigned int line = (single_vfo >= 0 && !pan_enabled) ? 6 : 3;
|
||||||
#else
|
#else
|
||||||
const unsigned int line = 3;
|
const unsigned int line = 3;
|
||||||
#endif
|
#endif
|
||||||
|
char str[22];
|
||||||
|
|
||||||
(void)rx;
|
(void)rx;
|
||||||
(void)line;
|
(void)line;
|
||||||
|
(void)str;
|
||||||
|
|
||||||
if (g_center_line != CENTER_LINE_NONE ||
|
if (
|
||||||
g_current_display_screen != DISPLAY_MAIN ||
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||||
|
#endif
|
||||||
|
g_center_line != CENTER_LINE_NONE || g_current_display_screen != DISPLAY_MAIN)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -592,8 +602,14 @@ void UI_DisplayCenterLine(void)
|
|||||||
const unsigned int len = strlen(g_dtmf_rx_live);
|
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
|
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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
g_center_line = CENTER_LINE_DTMF_DEC;
|
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 len = g_dtmf_rx_index;
|
||||||
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
|
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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
g_center_line = CENTER_LINE_DTMF_DEC;
|
g_center_line = CENTER_LINE_DTMF_DEC;
|
||||||
|
|
||||||
@ -623,8 +645,14 @@ void UI_DisplayCenterLine(void)
|
|||||||
else
|
else
|
||||||
if (g_charging_with_type_c)
|
if (g_charging_with_type_c)
|
||||||
{ // show the battery charge state
|
{ // 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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
g_center_line = CENTER_LINE_CHARGE_DATA;
|
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 y = 0;
|
||||||
unsigned int x = 0;
|
unsigned int x = 0;
|
||||||
|
|
||||||
#ifdef ENABLE_KILL_REVIVE
|
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||||
if (g_eeprom.config.setting.radio_disabled)
|
if (g_eeprom.config.setting.radio_disabled)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_SMALL_BOLD
|
#ifdef ENABLE_SMALL_BOLD
|
||||||
@ -962,11 +990,13 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
|
|||||||
//x += 7 * 7;
|
//x += 7 * 7;
|
||||||
|
|
||||||
// DTMF decoding symbol
|
// DTMF decoding symbol
|
||||||
str[0] = 0;
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
if (g_vfo_info[vfo_num].channel.dtmf_decoding_enable)
|
str[0] = 0;
|
||||||
strcpy(str, "DTMF");
|
if (g_vfo_info[vfo_num].channel.dtmf_decoding_enable)
|
||||||
UI_PrintStringSmall(str, LCD_WIDTH - (7 * 4), 0, y);
|
strcpy(str, "DTMF");
|
||||||
//x += 7 * 5;
|
UI_PrintStringSmall(str, LCD_WIDTH - (7 * 4), 0, y);
|
||||||
|
//x += 7 * 5;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
UI_DisplayCenterLine();
|
UI_DisplayCenterLine();
|
||||||
@ -1066,73 +1096,95 @@ void UI_DisplayMain(void)
|
|||||||
|
|
||||||
if (current_vfo_num != vfo_num)
|
if (current_vfo_num != vfo_num)
|
||||||
{
|
{
|
||||||
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE || g_dtmf_is_tx || g_dtmf_input_mode)
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
{ // show DTMF stuff
|
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE || g_dtmf_is_tx || g_dtmf_input_mode)
|
||||||
|
{ // show DTMF stuff
|
||||||
char contact[17];
|
|
||||||
|
char contact[17];
|
||||||
if (!g_dtmf_input_mode)
|
|
||||||
{
|
if (!g_dtmf_input_mode)
|
||||||
memset(contact, 0, sizeof(contact));
|
|
||||||
if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT)
|
|
||||||
{
|
{
|
||||||
strcpy(str, (g_dtmf_state == DTMF_STATE_CALL_OUT_RSP) ? "CALL OUT RESP" : "CALL OUT");
|
memset(contact, 0, sizeof(contact));
|
||||||
|
if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT)
|
||||||
|
{
|
||||||
|
strcpy(str, (g_dtmf_state == DTMF_STATE_CALL_OUT_RSP) ? "CALL OUT RESP" : "CALL OUT");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED || g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED_STAY)
|
||||||
|
{
|
||||||
|
const bool found = DTMF_FindContact(g_dtmf_caller, contact);
|
||||||
|
contact[8] = 0;
|
||||||
|
sprintf(str, "FROM %s", found ? contact : g_dtmf_caller);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (g_dtmf_is_tx)
|
||||||
|
{
|
||||||
|
strcpy(str, (g_dtmf_state == DTMF_STATE_TX_SUCC) ? "DTMF TX SUCC" : "DTMF TX");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED || g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED_STAY)
|
|
||||||
{
|
{
|
||||||
const bool found = DTMF_FindContact(g_dtmf_caller, contact);
|
sprintf(str, "DTMF entry");
|
||||||
contact[8] = 0;
|
}
|
||||||
sprintf(str, "FROM %s", found ? contact : g_dtmf_caller);
|
str[16] = 0;
|
||||||
|
UI_PrintString(str, 2, 0, 0 + (vfo_num * 3), 8);
|
||||||
|
|
||||||
|
memset(str, 0, sizeof(str));
|
||||||
|
if (!g_dtmf_input_mode)
|
||||||
|
{
|
||||||
|
memset(contact, 0, sizeof(contact));
|
||||||
|
if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT)
|
||||||
|
{
|
||||||
|
const bool found = DTMF_FindContact(g_dtmf_string, contact);
|
||||||
|
contact[15] = 0;
|
||||||
|
sprintf(str, ">%s", found ? contact : g_dtmf_string);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED || g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED_STAY)
|
||||||
|
{
|
||||||
|
const bool found = DTMF_FindContact(g_dtmf_callee, contact);
|
||||||
|
contact[15] = 0;
|
||||||
|
sprintf(str, ">%s", found ? contact : g_dtmf_callee);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (g_dtmf_is_tx)
|
||||||
|
{
|
||||||
|
sprintf(str, ">%s", g_dtmf_string);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (g_dtmf_is_tx)
|
|
||||||
{
|
{
|
||||||
strcpy(str, (g_dtmf_state == DTMF_STATE_TX_SUCC) ? "DTMF TX SUCC" : "DTMF TX");
|
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;
|
||||||
}
|
}
|
||||||
else
|
#else
|
||||||
{
|
if (g_dtmf_is_tx || g_dtmf_input_mode)
|
||||||
sprintf(str, "DTMF entry");
|
{ // 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;
|
||||||
}
|
}
|
||||||
str[16] = 0;
|
#endif
|
||||||
UI_PrintString(str, 2, 0, 0 + (vfo_num * 3), 8);
|
|
||||||
|
|
||||||
memset(str, 0, sizeof(str));
|
|
||||||
if (!g_dtmf_input_mode)
|
|
||||||
{
|
|
||||||
memset(contact, 0, sizeof(contact));
|
|
||||||
if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT)
|
|
||||||
{
|
|
||||||
const bool found = DTMF_FindContact(g_dtmf_string, contact);
|
|
||||||
contact[15] = 0;
|
|
||||||
sprintf(str, ">%s", found ? contact : g_dtmf_string);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED || g_dtmf_call_state == DTMF_CALL_STATE_RECEIVED_STAY)
|
|
||||||
{
|
|
||||||
const bool found = DTMF_FindContact(g_dtmf_callee, contact);
|
|
||||||
contact[15] = 0;
|
|
||||||
sprintf(str, ">%s", found ? contact : g_dtmf_callee);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (g_dtmf_is_tx)
|
|
||||||
{
|
|
||||||
sprintf(str, ">%s", g_dtmf_string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (single_vfo < 0)
|
if (single_vfo < 0)
|
||||||
@ -1513,13 +1565,15 @@ void UI_DisplayMain(void)
|
|||||||
UI_PrintStringSmall(str, 70, 0, line + 2);
|
UI_PrintStringSmall(str, 70, 0, line + 2);
|
||||||
|
|
||||||
// show the DTMF decoding symbol
|
// show the DTMF decoding symbol
|
||||||
#ifdef ENABLE_KILL_REVIVE
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
if (g_vfo_info[vfo_num].channel.dtmf_decoding_enable || g_eeprom.config.setting.radio_disabled)
|
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||||
UI_PrintStringSmall("DTMF", 78, 0, line + 2);
|
if (g_vfo_info[vfo_num].channel.dtmf_decoding_enable || g_eeprom.config.setting.radio_disabled)
|
||||||
#else
|
UI_PrintStringSmall("DTMF", 78, 0, line + 2);
|
||||||
if (g_vfo_info[vfo_num].channel.dtmf_decoding_enable)
|
#else
|
||||||
UI_PrintStringSmall("DTMF", 78, 0, line + 2);
|
if (g_vfo_info[vfo_num].channel.dtmf_decoding_enable)
|
||||||
//UI_PrintStringSmallest("DTMF", 78, (line + 2) * 8, false, true);
|
UI_PrintStringSmall("DTMF", 78, 0, line + 2);
|
||||||
|
//UI_PrintStringSmallest("DTMF", 78, (line + 2) * 8, false, true);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// show the audio scramble symbol
|
// show the audio scramble symbol
|
||||||
|
175
ui/menu.c
175
ui/menu.c
@ -109,7 +109,9 @@ const t_menu_item g_menu_list[] =
|
|||||||
#ifdef ENABLE_ALARM
|
#ifdef ENABLE_ALARM
|
||||||
{"SOS AL", VOICE_ID_INVALID, MENU_ALARM_MODE }, // was "ALMODE"
|
{"SOS AL", VOICE_ID_INVALID, MENU_ALARM_MODE }, // was "ALMODE"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
{"ANI ID", VOICE_ID_ANI_CODE, MENU_ANI_ID },
|
{"ANI ID", VOICE_ID_ANI_CODE, MENU_ANI_ID },
|
||||||
|
#endif
|
||||||
{"UpCODE", VOICE_ID_INVALID, MENU_UP_CODE },
|
{"UpCODE", VOICE_ID_INVALID, MENU_UP_CODE },
|
||||||
{"DnCODE", VOICE_ID_INVALID, MENU_DN_CODE }, // was "DWCODE"
|
{"DnCODE", VOICE_ID_INVALID, MENU_DN_CODE }, // was "DWCODE"
|
||||||
#ifdef ENABLE_MDC1200
|
#ifdef ENABLE_MDC1200
|
||||||
@ -118,10 +120,12 @@ const t_menu_item g_menu_list[] =
|
|||||||
#endif
|
#endif
|
||||||
{"PTT ID", VOICE_ID_INVALID, MENU_PTT_ID },
|
{"PTT ID", VOICE_ID_INVALID, MENU_PTT_ID },
|
||||||
{"D ST", VOICE_ID_INVALID, MENU_DTMF_ST },
|
{"D ST", VOICE_ID_INVALID, MENU_DTMF_ST },
|
||||||
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
{"D RSP", VOICE_ID_INVALID, MENU_DTMF_RSP },
|
{"D RSP", VOICE_ID_INVALID, MENU_DTMF_RSP },
|
||||||
{"D HOLD", VOICE_ID_INVALID, MENU_DTMF_HOLD },
|
{"D HOLD", VOICE_ID_INVALID, MENU_DTMF_HOLD },
|
||||||
{"D DCD", VOICE_ID_INVALID, MENU_DTMF_DCD },
|
{"D DCD", VOICE_ID_INVALID, MENU_DTMF_DCD },
|
||||||
{"D LIST", VOICE_ID_INVALID, MENU_DTMF_LIST },
|
{"D LIST", VOICE_ID_INVALID, MENU_DTMF_LIST },
|
||||||
|
#endif
|
||||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
{"D LIVE", VOICE_ID_INVALID, MENU_DTMF_LIVE_DEC }, // live DTMF decoder
|
{"D LIVE", VOICE_ID_INVALID, MENU_DTMF_LIVE_DEC }, // live DTMF decoder
|
||||||
#endif
|
#endif
|
||||||
@ -298,13 +302,15 @@ const char g_sub_menu_mem_disp[4][12] =
|
|||||||
};
|
};
|
||||||
#endif
|
#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",
|
"NONE",
|
||||||
"REPLY",
|
"RING",
|
||||||
"RNG RPLY"
|
"REPLY",
|
||||||
};
|
"RNG RPLY"
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
const char g_sub_menu_ptt_id[5][16] =
|
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]);
|
strcat(str, g_sub_menu_off_on[g_sub_menu_selection]);
|
||||||
break;
|
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:
|
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;
|
||||||
|
#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
|
#endif
|
||||||
case MENU_DTMF_DCD:
|
|
||||||
strcpy(str, "DTMF\nDECODE\n");
|
|
||||||
strcat(str, g_sub_menu_off_on[g_sub_menu_selection]);
|
|
||||||
channel_setting = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MENU_STE:
|
case MENU_STE:
|
||||||
strcpy(str, "SUB TAIL\nELIMIN\n");
|
strcpy(str, "SUB TAIL\nELIMIN\n");
|
||||||
@ -1028,10 +1046,12 @@ void UI_DisplayMenu(void)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case MENU_ANI_ID:
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
strcpy(str, "DTMF ID\n");
|
case MENU_ANI_ID:
|
||||||
strcat(str, g_eeprom.config.setting.dtmf.ani_id);
|
strcpy(str, "DTMF ID\n");
|
||||||
break;
|
strcat(str, g_eeprom.config.setting.dtmf.ani_id);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case MENU_UP_CODE:
|
case MENU_UP_CODE:
|
||||||
strcpy(str, "DTMF BOT\n");
|
strcpy(str, "DTMF BOT\n");
|
||||||
@ -1045,39 +1065,66 @@ void UI_DisplayMenu(void)
|
|||||||
channel_setting = true;
|
channel_setting = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_DTMF_RSP:
|
case MENU_PTT_ID:
|
||||||
strcpy(str, "DTMF\nRESP\n");
|
strcpy(str, g_sub_menu_ptt_id[g_sub_menu_selection]);
|
||||||
strcat(str, g_sub_menu_dtmf_rsp[g_sub_menu_selection]);
|
|
||||||
channel_setting = true;
|
channel_setting = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_DTMF_HOLD:
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
// only allow 5, 10, 20, 30, 40, 50 or "STAY ON SCREEN" (60)
|
case MENU_DTMF_RSP:
|
||||||
switch (g_sub_menu_selection)
|
strcpy(str, "DTMF\nRESP\n");
|
||||||
|
strcat(str, g_sub_menu_dtmf_rsp[g_sub_menu_selection]);
|
||||||
|
channel_setting = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MENU_DTMF_HOLD:
|
||||||
|
// only allow 5, 10, 20, 30, 40, 50 or "STAY ON SCREEN" (60)
|
||||||
|
switch (g_sub_menu_selection)
|
||||||
|
{
|
||||||
|
case 4: g_sub_menu_selection = 60; break;
|
||||||
|
case 6: g_sub_menu_selection = 10; break;
|
||||||
|
case 9: g_sub_menu_selection = 5; break;
|
||||||
|
case 11: g_sub_menu_selection = 20; break;
|
||||||
|
case 19: g_sub_menu_selection = 10; break;
|
||||||
|
case 21: g_sub_menu_selection = 30; break;
|
||||||
|
case 29: g_sub_menu_selection = 20; break;
|
||||||
|
case 31: g_sub_menu_selection = 40; break;
|
||||||
|
case 39: g_sub_menu_selection = 30; break;
|
||||||
|
case 41: g_sub_menu_selection = 50; break;
|
||||||
|
case 49: g_sub_menu_selection = 40; break;
|
||||||
|
case 51: g_sub_menu_selection = 60; break;
|
||||||
|
case 59: g_sub_menu_selection = 50; break;
|
||||||
|
case 61: g_sub_menu_selection = 5; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
strcpy(str, "DTMF MSG\n");
|
||||||
|
if (g_sub_menu_selection < DTMF_HOLD_MAX)
|
||||||
|
sprintf(str + strlen(str), "%d sec", g_sub_menu_selection);
|
||||||
|
else
|
||||||
|
strcat(str, "STAY ON\nSCRN"); // 60
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MENU_DTMF_LIST:
|
||||||
{
|
{
|
||||||
case 4: g_sub_menu_selection = 60; break;
|
char Contact[17];
|
||||||
case 6: g_sub_menu_selection = 10; break;
|
g_dtmf_is_contact_valid = DTMF_GetContact((int)g_sub_menu_selection - 1, Contact);
|
||||||
case 9: g_sub_menu_selection = 5; break;
|
strcpy(str, "DTMF\n");
|
||||||
case 11: g_sub_menu_selection = 20; break;
|
if (!g_dtmf_is_contact_valid)
|
||||||
case 19: g_sub_menu_selection = 10; break;
|
{
|
||||||
case 21: g_sub_menu_selection = 30; break;
|
strcat(str, "NULL");
|
||||||
case 29: g_sub_menu_selection = 20; break;
|
}
|
||||||
case 31: g_sub_menu_selection = 40; break;
|
else
|
||||||
case 39: g_sub_menu_selection = 30; break;
|
{
|
||||||
case 41: g_sub_menu_selection = 50; break;
|
memcpy(str + strlen(str), Contact, 8);
|
||||||
case 49: g_sub_menu_selection = 40; break;
|
Contact[11] = 0;
|
||||||
case 51: g_sub_menu_selection = 60; break;
|
memcpy(&g_dtmf_id, Contact + 8, sizeof(g_dtmf_id));
|
||||||
case 59: g_sub_menu_selection = 50; break;
|
sprintf(str + strlen(str), "\nID:%s", Contact + 8);
|
||||||
case 61: g_sub_menu_selection = 5; break;
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(str, "DTMF MSG\n");
|
#endif
|
||||||
if (g_sub_menu_selection < DTMF_HOLD_MAX)
|
|
||||||
sprintf(str + strlen(str), "%d sec", g_sub_menu_selection);
|
|
||||||
else
|
|
||||||
strcat(str, "STAY ON\nSCRN"); // 60
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
#ifdef ENABLE_DTMF_TIMING_SETTINGS
|
#ifdef ENABLE_DTMF_TIMING_SETTINGS
|
||||||
case MENU_DTMF_PRE:
|
case MENU_DTMF_PRE:
|
||||||
@ -1120,34 +1167,10 @@ void UI_DisplayMenu(void)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case MENU_PTT_ID:
|
|
||||||
strcpy(str, g_sub_menu_ptt_id[g_sub_menu_selection]);
|
|
||||||
channel_setting = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MENU_BAT_TXT:
|
case MENU_BAT_TXT:
|
||||||
strcpy(str, g_sub_menu_bat_text[g_sub_menu_selection]);
|
strcpy(str, g_sub_menu_bat_text[g_sub_menu_selection]);
|
||||||
break;
|
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:
|
case MENU_PON_MSG:
|
||||||
strcpy(str, g_sub_menu_pwr_on_msg[g_sub_menu_selection]);
|
strcpy(str, g_sub_menu_pwr_on_msg[g_sub_menu_selection]);
|
||||||
break;
|
break;
|
||||||
@ -1421,17 +1444,23 @@ void UI_DisplayMenu(void)
|
|||||||
if (strlen(g_eeprom.config.setting.dtmf.key_down_code) > 8)
|
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);
|
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_TX_CTCSS ||
|
||||||
g_menu_cursor == MENU_RX_CDCSS ||
|
g_menu_cursor == MENU_RX_CDCSS ||
|
||||||
g_menu_cursor == MENU_TX_CDCSS ||
|
g_menu_cursor == MENU_TX_CDCSS)
|
||||||
g_menu_cursor == MENU_DTMF_LIST)
|
|
||||||
{
|
{
|
||||||
if (g_in_sub_menu)
|
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);
|
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);
|
UI_Displaysmall_digits(Offset, str + (8 - Offset), 105, 0, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,14 +95,18 @@ enum
|
|||||||
MENU_S_LIST,
|
MENU_S_LIST,
|
||||||
MENU_SLIST1,
|
MENU_SLIST1,
|
||||||
MENU_SLIST2,
|
MENU_SLIST2,
|
||||||
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
MENU_ANI_ID,
|
MENU_ANI_ID,
|
||||||
|
#endif
|
||||||
MENU_UP_CODE,
|
MENU_UP_CODE,
|
||||||
MENU_DN_CODE,
|
MENU_DN_CODE,
|
||||||
MENU_DTMF_ST,
|
MENU_DTMF_ST,
|
||||||
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
MENU_DTMF_HOLD,
|
MENU_DTMF_HOLD,
|
||||||
MENU_DTMF_LIST,
|
MENU_DTMF_LIST,
|
||||||
MENU_DTMF_RSP,
|
MENU_DTMF_RSP,
|
||||||
MENU_DTMF_DCD,
|
MENU_DTMF_DCD,
|
||||||
|
#endif
|
||||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
MENU_DTMF_LIVE_DEC,
|
MENU_DTMF_LIVE_DEC,
|
||||||
#endif
|
#endif
|
||||||
@ -200,7 +204,9 @@ extern const char g_sub_menu_mem_disp[4][12];
|
|||||||
#ifdef ENABLE_ALARM
|
#ifdef ENABLE_ALARM
|
||||||
extern const char g_sub_menu_alarm_mode[2][5];
|
extern const char g_sub_menu_alarm_mode[2][5];
|
||||||
#endif
|
#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];
|
extern const char g_sub_menu_ptt_id[5][16];
|
||||||
#ifdef ENABLE_MDC1200
|
#ifdef ENABLE_MDC1200
|
||||||
extern const char g_sub_menu_mdc1200_mode[4][5];
|
extern const char g_sub_menu_mdc1200_mode[4][5];
|
||||||
|
@ -80,7 +80,7 @@ void UI_DisplayStatus(const bool test_display)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_KILL_REVIVE
|
#ifdef ENABLE_DTMF_KILL_REVIVE
|
||||||
if (g_eeprom.config.setting.radio_disabled)
|
if (g_eeprom.config.setting.radio_disabled)
|
||||||
{
|
{
|
||||||
memset(line + x, 0xFF, 10);
|
memset(line + x, 0xFF, 10);
|
||||||
@ -143,7 +143,9 @@ void UI_DisplayStatus(const bool test_display)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (g_dual_watch_tick_10ms > dual_watch_delay_toggle_10ms ||
|
if (g_dual_watch_tick_10ms > dual_watch_delay_toggle_10ms ||
|
||||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
|
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||||
|
#endif
|
||||||
g_scan_state_dir != SCAN_STATE_DIR_OFF ||
|
g_scan_state_dir != SCAN_STATE_DIR_OFF ||
|
||||||
g_css_scan_mode != CSS_SCAN_MODE_OFF ||
|
g_css_scan_mode != CSS_SCAN_MODE_OFF ||
|
||||||
(g_current_function != FUNCTION_FOREGROUND && g_current_function != FUNCTION_POWER_SAVE) ||
|
(g_current_function != FUNCTION_FOREGROUND && g_current_function != FUNCTION_POWER_SAVE) ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user