mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-27 22:01:26 +03:00
added DTMF live decoder makefile option
This commit is contained in:
parent
1d9cdeecf5
commit
010721deac
4
Makefile
4
Makefile
@ -39,6 +39,7 @@ 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_SHOW_FREQS_CHAN := 0
|
ENABLE_SHOW_FREQS_CHAN := 0
|
||||||
# smaa bolf 580 B
|
# smaa bolf 580 B
|
||||||
ENABLE_SMALL_BOLD := 1
|
ENABLE_SMALL_BOLD := 1
|
||||||
@ -327,6 +328,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_LIVE_DECODER),1)
|
||||||
|
CFLAGS += -DENABLE_DTMF_LIVE_DECODER
|
||||||
|
endif
|
||||||
ifeq ($(ENABLE_SHOW_FREQS_CHAN),1)
|
ifeq ($(ENABLE_SHOW_FREQS_CHAN),1)
|
||||||
CFLAGS += -DENABLE_SHOW_FREQS_CHAN
|
CFLAGS += -DENABLE_SHOW_FREQS_CHAN
|
||||||
endif
|
endif
|
||||||
|
@ -64,6 +64,7 @@ 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_LIVE_DECODER := 0 enable the live DTMF display/decoder .. adds a menu option
|
||||||
ENABLE_SHOW_FREQS_CHAN := 1 show the channel name under the frequency if the frequency is found in a channel
|
ENABLE_SHOW_FREQS_CHAN := 1 show the channel name under the frequency if the frequency is found in a channel
|
||||||
ENABLE_SMALL_BOLD := 1 bold channel name/no. (when name + freq channel display mode)
|
ENABLE_SMALL_BOLD := 1 bold channel name/no. (when name + freq channel display mode)
|
||||||
ENABLE_TRIM_TRAILING_ZEROS := 1 trim away any trailing zeros on frequencies
|
ENABLE_TRIM_TRAILING_ZEROS := 1 trim away any trailing zeros on frequencies
|
||||||
|
@ -209,8 +209,10 @@ void ACTION_Scan(bool bRestart)
|
|||||||
|
|
||||||
DTMF_clear_RX();
|
DTMF_clear_RX();
|
||||||
|
|
||||||
g_dtmf_rx_live_timeout = 0;
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
|
g_dtmf_rx_live_timeout = 0;
|
||||||
|
memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
|
||||||
|
#endif
|
||||||
|
|
||||||
RADIO_select_vfos();
|
RADIO_select_vfos();
|
||||||
|
|
||||||
|
155
app/app.c
155
app/app.c
@ -986,19 +986,21 @@ void APP_process_radio_interrupts(void)
|
|||||||
const char c = DTMF_GetCharacter(BK4819_GetDTMF_5TONE_Code());
|
const char c = DTMF_GetCharacter(BK4819_GetDTMF_5TONE_Code());
|
||||||
if (c != 0xff && g_current_function != FUNCTION_TRANSMIT)
|
if (c != 0xff && g_current_function != FUNCTION_TRANSMIT)
|
||||||
{
|
{
|
||||||
if (g_eeprom.config.setting.dtmf_live_decoder)
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
{
|
if (g_eeprom.config.setting.dtmf_live_decoder)
|
||||||
size_t len = strlen(g_dtmf_rx_live);
|
{
|
||||||
if (len >= (sizeof(g_dtmf_rx_live) - 1))
|
size_t len = strlen(g_dtmf_rx_live);
|
||||||
{ // make room
|
if (len >= (sizeof(g_dtmf_rx_live) - 1))
|
||||||
memmove(&g_dtmf_rx_live[0], &g_dtmf_rx_live[1], sizeof(g_dtmf_rx_live) - 1);
|
{ // make room
|
||||||
len--;
|
memmove(&g_dtmf_rx_live[0], &g_dtmf_rx_live[1], sizeof(g_dtmf_rx_live) - 1);
|
||||||
|
len--;
|
||||||
|
}
|
||||||
|
g_dtmf_rx_live[len++] = c;
|
||||||
|
g_dtmf_rx_live[len] = 0;
|
||||||
|
g_dtmf_rx_live_timeout = dtmf_rx_live_timeout_500ms; // time till we delete it
|
||||||
|
g_update_display = true;
|
||||||
}
|
}
|
||||||
g_dtmf_rx_live[len++] = c;
|
#endif
|
||||||
g_dtmf_rx_live[len] = 0;
|
|
||||||
g_dtmf_rx_live_timeout = dtmf_rx_live_timeout_500ms; // time till we delete it
|
|
||||||
g_update_display = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef ENABLE_KILL_REVIVE
|
#ifdef ENABLE_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)
|
||||||
@ -1264,9 +1266,14 @@ void APP_end_tx(void)
|
|||||||
if (g_current_function == FUNCTION_POWER_SAVE)
|
if (g_current_function == FUNCTION_POWER_SAVE)
|
||||||
FUNCTION_Select(FUNCTION_FOREGROUND);
|
FUNCTION_Select(FUNCTION_FOREGROUND);
|
||||||
|
|
||||||
if (g_current_function == FUNCTION_TRANSMIT || g_serial_config_tick_500ms > 0)
|
if (g_current_function == FUNCTION_TRANSMIT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#if defined(ENABLE_UART)
|
||||||
|
if (g_serial_config_tick_500ms > 0)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
// ************* go into TX mode
|
// ************* go into TX mode
|
||||||
|
|
||||||
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
||||||
@ -1303,25 +1310,31 @@ void APP_process_keys(void)
|
|||||||
if (ptt_pressed)
|
if (ptt_pressed)
|
||||||
{ // PTT pressed
|
{ // PTT pressed
|
||||||
|
|
||||||
#ifdef ENABLE_AIRCOPY
|
if (!g_ptt_is_pressed && g_eeprom.config.setting.tx_enable && g_current_function != FUNCTION_TRANSMIT)
|
||||||
if (!g_ptt_is_pressed && g_serial_config_tick_500ms == 0 && g_eeprom.config.setting.tx_enable && g_current_function != FUNCTION_TRANSMIT && g_current_display_screen != DISPLAY_AIRCOPY)
|
|
||||||
#else
|
|
||||||
if (!g_ptt_is_pressed && g_serial_config_tick_500ms == 0 && g_eeprom.config.setting.tx_enable && g_current_function != FUNCTION_TRANSMIT)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_KILL_REVIVE
|
#if defined(ENABLE_UART)
|
||||||
if (!g_eeprom.config.setting.radio_disabled)
|
if (g_serial_config_tick_500ms == 0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (++g_ptt_debounce >= 3) // 30ms debounce
|
#ifdef ENABLE_AIRCOPY
|
||||||
{ // start TX'ing
|
if (g_current_display_screen != DISPLAY_AIRCOPY)
|
||||||
|
#endif
|
||||||
g_boot_tick_10ms = 0; // cancel the boot-up screen
|
{
|
||||||
g_ptt_is_pressed = ptt_pressed;
|
#ifdef ENABLE_KILL_REVIVE
|
||||||
g_ptt_was_released = false;
|
if (!g_eeprom.config.setting.radio_disabled)
|
||||||
g_ptt_debounce = 3;
|
#endif
|
||||||
|
{
|
||||||
APP_process_key(KEY_PTT, true, false);
|
if (++g_ptt_debounce >= 3) // 30ms debounce
|
||||||
|
{ // start TX'ing
|
||||||
|
|
||||||
|
g_boot_tick_10ms = 0; // cancel the boot-up screen
|
||||||
|
g_ptt_is_pressed = ptt_pressed;
|
||||||
|
g_ptt_was_released = false;
|
||||||
|
g_ptt_debounce = 3;
|
||||||
|
|
||||||
|
APP_process_key(KEY_PTT, true, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1329,7 +1342,11 @@ void APP_process_keys(void)
|
|||||||
else
|
else
|
||||||
{ // PTT released
|
{ // PTT released
|
||||||
|
|
||||||
|
#if defined(ENABLE_UART)
|
||||||
if (g_ptt_is_pressed || g_serial_config_tick_500ms > 0)
|
if (g_ptt_is_pressed || g_serial_config_tick_500ms > 0)
|
||||||
|
#else
|
||||||
|
if (g_ptt_is_pressed)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
// if (g_ptt_debounce > 0)
|
// if (g_ptt_debounce > 0)
|
||||||
{
|
{
|
||||||
@ -1357,15 +1374,17 @@ void APP_process_keys(void)
|
|||||||
// scan the hardware keys
|
// scan the hardware keys
|
||||||
key = KEYBOARD_Poll();
|
key = KEYBOARD_Poll();
|
||||||
|
|
||||||
if (g_serial_config_tick_500ms > 0)
|
#if defined(ENABLE_UART)
|
||||||
{ // config upload/download in progress
|
if (g_serial_config_tick_500ms > 0)
|
||||||
g_key_debounce_press = 0;
|
{ // config upload/download in progress
|
||||||
g_key_debounce_repeat = 0;
|
g_key_debounce_press = 0;
|
||||||
g_key_prev = KEY_INVALID;
|
g_key_debounce_repeat = 0;
|
||||||
g_key_held = false;
|
g_key_prev = KEY_INVALID;
|
||||||
g_fkey_pressed = false;
|
g_key_held = false;
|
||||||
return;
|
g_fkey_pressed = false;
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (key == KEY_INVALID || (g_key_prev != KEY_INVALID && key != g_key_prev))
|
if (key == KEY_INVALID || (g_key_prev != KEY_INVALID && key != g_key_prev))
|
||||||
{ // key not pressed or different key pressed
|
{ // key not pressed or different key pressed
|
||||||
@ -1974,7 +1993,9 @@ void APP_time_slice_500ms(void)
|
|||||||
|
|
||||||
if (g_beep_to_play != BEEP_NONE)
|
if (g_beep_to_play != BEEP_NONE)
|
||||||
{
|
{
|
||||||
|
#if defined(ENABLE_UART)
|
||||||
if (g_serial_config_tick_500ms == 0)
|
if (g_serial_config_tick_500ms == 0)
|
||||||
|
#endif
|
||||||
AUDIO_PlayBeep(g_beep_to_play);
|
AUDIO_PlayBeep(g_beep_to_play);
|
||||||
g_beep_to_play = BEEP_NONE;
|
g_beep_to_play = BEEP_NONE;
|
||||||
}
|
}
|
||||||
@ -1995,10 +2016,10 @@ void APP_time_slice_500ms(void)
|
|||||||
if (--g_keypad_locked == 0)
|
if (--g_keypad_locked == 0)
|
||||||
g_update_display = true;
|
g_update_display = true;
|
||||||
|
|
||||||
if (g_serial_config_tick_500ms > 0)
|
#if defined(ENABLE_UART)
|
||||||
{ // config upload/download is running
|
if (g_serial_config_tick_500ms > 0)
|
||||||
return;
|
return;
|
||||||
}
|
#endif
|
||||||
|
|
||||||
if (g_current_function == FUNCTION_TRANSMIT)
|
if (g_current_function == FUNCTION_TRANSMIT)
|
||||||
{
|
{
|
||||||
@ -2039,23 +2060,25 @@ void APP_time_slice_500ms(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (g_dtmf_rx_live_timeout > 0)
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
{
|
if (g_dtmf_rx_live_timeout > 0)
|
||||||
#ifdef ENABLE_RX_SIGNAL_BAR
|
|
||||||
if (g_center_line == CENTER_LINE_DTMF_DEC ||
|
|
||||||
g_center_line == CENTER_LINE_NONE) // wait till the center line is free for us to use before timing out
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (--g_dtmf_rx_live_timeout == 0)
|
#ifdef ENABLE_RX_SIGNAL_BAR
|
||||||
|
if (g_center_line == CENTER_LINE_DTMF_DEC ||
|
||||||
|
g_center_line == CENTER_LINE_NONE) // wait till the center line is free for us to use before timing out
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if (g_dtmf_rx_live[0] != 0)
|
if (--g_dtmf_rx_live_timeout == 0)
|
||||||
{
|
{
|
||||||
memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
|
if (g_dtmf_rx_live[0] != 0)
|
||||||
g_update_display = true;
|
{
|
||||||
|
memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
|
||||||
|
g_update_display = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
#endif
|
||||||
|
|
||||||
if (g_menu_tick_10ms > 0)
|
if (g_menu_tick_10ms > 0)
|
||||||
if (--g_menu_tick_10ms == 0)
|
if (--g_menu_tick_10ms == 0)
|
||||||
@ -2412,7 +2435,11 @@ void APP_time_slice_10ms(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(ENABLE_UART)
|
||||||
if (g_current_function == FUNCTION_TRANSMIT && (g_tx_timeout_reached || g_serial_config_tick_500ms > 0))
|
if (g_current_function == FUNCTION_TRANSMIT && (g_tx_timeout_reached || g_serial_config_tick_500ms > 0))
|
||||||
|
#else
|
||||||
|
if (g_current_function == FUNCTION_TRANSMIT && g_tx_timeout_reached)
|
||||||
|
#endif
|
||||||
{ // transmitter timed out or must de-key
|
{ // transmitter timed out or must de-key
|
||||||
|
|
||||||
BK4819_stop_tones(true);
|
BK4819_stop_tones(true);
|
||||||
@ -2450,7 +2477,11 @@ void APP_time_slice_10ms(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(ENABLE_UART)
|
||||||
if (g_reduced_service || g_serial_config_tick_500ms > 0)
|
if (g_reduced_service || g_serial_config_tick_500ms > 0)
|
||||||
|
#else
|
||||||
|
if (g_reduced_service)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if (g_current_function == FUNCTION_TRANSMIT)
|
if (g_current_function == FUNCTION_TRANSMIT)
|
||||||
g_tx_timeout_reached = true;
|
g_tx_timeout_reached = true;
|
||||||
@ -2659,13 +2690,15 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const
|
|||||||
if (Key == KEY_EXIT && key_held && key_pressed)
|
if (Key == KEY_EXIT && key_held && key_pressed)
|
||||||
{ // exit key held pressed
|
{ // exit key held pressed
|
||||||
|
|
||||||
// clear the live DTMF decoder
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
if (g_dtmf_rx_live[0] != 0)
|
// clear the live DTMF decoder
|
||||||
{
|
if (g_dtmf_rx_live[0] != 0)
|
||||||
memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
|
{
|
||||||
g_dtmf_rx_live_timeout = 0;
|
memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
|
||||||
g_update_display = true;
|
g_dtmf_rx_live_timeout = 0;
|
||||||
}
|
g_update_display = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// cancel user input
|
// cancel user input
|
||||||
APP_cancel_user_input_modes();
|
APP_cancel_user_input_modes();
|
||||||
|
@ -46,8 +46,10 @@ uint8_t g_dtmf_rx_index;
|
|||||||
uint8_t g_dtmf_rx_timeout;
|
uint8_t g_dtmf_rx_timeout;
|
||||||
bool g_dtmf_rx_pending;
|
bool g_dtmf_rx_pending;
|
||||||
|
|
||||||
char g_dtmf_rx_live[20];
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
uint8_t g_dtmf_rx_live_timeout;
|
char g_dtmf_rx_live[20];
|
||||||
|
uint8_t g_dtmf_rx_live_timeout;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool g_dtmf_is_contact_valid;
|
bool g_dtmf_is_contact_valid;
|
||||||
char g_dtmf_id[4];
|
char g_dtmf_id[4];
|
||||||
|
@ -77,8 +77,10 @@ extern uint8_t g_dtmf_rx_index;
|
|||||||
extern uint8_t g_dtmf_rx_timeout;
|
extern uint8_t g_dtmf_rx_timeout;
|
||||||
extern bool g_dtmf_rx_pending;
|
extern bool g_dtmf_rx_pending;
|
||||||
|
|
||||||
extern char g_dtmf_rx_live[20];
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
extern uint8_t g_dtmf_rx_live_timeout;
|
extern char g_dtmf_rx_live[20];
|
||||||
|
extern uint8_t g_dtmf_rx_live_timeout;
|
||||||
|
#endif
|
||||||
|
|
||||||
extern bool g_dtmf_is_contact_valid;
|
extern bool g_dtmf_is_contact_valid;
|
||||||
extern char g_dtmf_id[4];
|
extern char g_dtmf_id[4];
|
||||||
|
@ -99,7 +99,11 @@ void GENERIC_Key_PTT(bool key_pressed)
|
|||||||
{
|
{
|
||||||
g_input_box_index = 0;
|
g_input_box_index = 0;
|
||||||
|
|
||||||
|
#if defined(ENABLE_UART)
|
||||||
if (!key_pressed || g_serial_config_tick_500ms > 0)
|
if (!key_pressed || g_serial_config_tick_500ms > 0)
|
||||||
|
#else
|
||||||
|
if (!key_pressed)
|
||||||
|
#endif
|
||||||
{ // PTT released
|
{ // PTT released
|
||||||
|
|
||||||
if (g_current_function == FUNCTION_TRANSMIT)
|
if (g_current_function == FUNCTION_TRANSMIT)
|
||||||
|
34
app/menu.c
34
app/menu.c
@ -264,7 +264,9 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
|||||||
case MENU_STE:
|
case MENU_STE:
|
||||||
case MENU_DTMF_ST:
|
case MENU_DTMF_ST:
|
||||||
case MENU_DTMF_DCD:
|
case MENU_DTMF_DCD:
|
||||||
case MENU_DTMF_LIVE_DEC:
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
|
case MENU_DTMF_LIVE_DEC:
|
||||||
|
#endif
|
||||||
*pMin = 0;
|
*pMin = 0;
|
||||||
*pMax = ARRAY_SIZE(g_sub_menu_off_on) - 1;
|
*pMax = ARRAY_SIZE(g_sub_menu_off_on) - 1;
|
||||||
break;
|
break;
|
||||||
@ -771,15 +773,17 @@ void MENU_AcceptSetting(void)
|
|||||||
g_request_save_channel = 1;
|
g_request_save_channel = 1;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case MENU_DTMF_LIVE_DEC:
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
g_eeprom.config.setting.dtmf_live_decoder = g_sub_menu_selection;
|
case MENU_DTMF_LIVE_DEC:
|
||||||
g_dtmf_rx_live_timeout = 0;
|
g_eeprom.config.setting.dtmf_live_decoder = g_sub_menu_selection;
|
||||||
memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
|
g_dtmf_rx_live_timeout = 0;
|
||||||
if (!g_eeprom.config.setting.dtmf_live_decoder)
|
memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
|
||||||
BK4819_DisableDTMF();
|
if (!g_eeprom.config.setting.dtmf_live_decoder)
|
||||||
g_flag_reconfigure_vfos = true;
|
BK4819_DisableDTMF();
|
||||||
g_update_status = true;
|
g_flag_reconfigure_vfos = true;
|
||||||
break;
|
g_update_status = true;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case MENU_DTMF_LIST:
|
case MENU_DTMF_LIST:
|
||||||
g_dtmf_chosen_contact = g_sub_menu_selection - 1;
|
g_dtmf_chosen_contact = g_sub_menu_selection - 1;
|
||||||
@ -1285,9 +1289,11 @@ void MENU_ShowCurrentSetting(void)
|
|||||||
g_sub_menu_selection = g_dtmf_chosen_contact + 1;
|
g_sub_menu_selection = g_dtmf_chosen_contact + 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_DTMF_LIVE_DEC:
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.dtmf_live_decoder;
|
case MENU_DTMF_LIVE_DEC:
|
||||||
break;
|
g_sub_menu_selection = g_eeprom.config.setting.dtmf_live_decoder;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case MENU_PON_MSG:
|
case MENU_PON_MSG:
|
||||||
g_sub_menu_selection = g_eeprom.config.setting.power_on_display_mode;
|
g_sub_menu_selection = g_eeprom.config.setting.power_on_display_mode;
|
||||||
@ -1712,7 +1718,7 @@ static void MENU_Key_MENU(const bool key_pressed, const bool key_held)
|
|||||||
g_edit_index = g_tx_vfo->channel.tx_power_user;
|
g_edit_index = g_tx_vfo->channel.tx_power_user;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{ // save the new power level
|
||||||
g_tx_vfo->channel.tx_power_user = g_edit_index;
|
g_tx_vfo->channel.tx_power_user = g_edit_index;
|
||||||
g_request_save_channel = 1;
|
g_request_save_channel = 1;
|
||||||
|
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -215,9 +215,11 @@ void FUNCTION_Select(function_type_t Function)
|
|||||||
// clear the DTMF RX buffer
|
// clear the DTMF RX buffer
|
||||||
DTMF_clear_RX();
|
DTMF_clear_RX();
|
||||||
|
|
||||||
// clear the DTMF RX live decoder buffer
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
g_dtmf_rx_live_timeout = 0;
|
// clear the DTMF RX live decoder buffer
|
||||||
memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
|
g_dtmf_rx_live_timeout = 0;
|
||||||
|
memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
// disable the FM radio
|
// disable the FM radio
|
||||||
|
8
misc.c
8
misc.c
@ -33,7 +33,9 @@ const uint16_t menu_timeout_long_500ms = 120000 / 500; // 2 min
|
|||||||
|
|
||||||
const uint16_t backlight_tx_rx_time_secs = 10; // 10 seconds
|
const uint16_t backlight_tx_rx_time_secs = 10; // 10 seconds
|
||||||
|
|
||||||
const uint8_t dtmf_rx_live_timeout_500ms = 6000 / 500; // 6 seconds live decoder on screen
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
|
const uint8_t dtmf_rx_live_timeout_500ms = 6000 / 500; // 6 seconds live decoder on screen
|
||||||
|
#endif
|
||||||
const uint8_t dtmf_rx_timeout_500ms = 10000 / 500; // 10 seconds till we wipe the DTMF receiver
|
const uint8_t dtmf_rx_timeout_500ms = 10000 / 500; // 10 seconds till we wipe the DTMF receiver
|
||||||
const uint8_t dtmf_decode_ring_500ms = 15000 / 500; // 15 seconds .. time we sound the ringing for
|
const uint8_t dtmf_decode_ring_500ms = 15000 / 500; // 15 seconds .. time we sound the ringing for
|
||||||
const uint8_t dtmf_txstop_500ms = 3000 / 500; // 6 seconds
|
const uint8_t dtmf_txstop_500ms = 3000 / 500; // 6 seconds
|
||||||
@ -101,7 +103,9 @@ volatile bool g_power_save_expired;
|
|||||||
volatile uint16_t g_dual_watch_tick_10ms;
|
volatile uint16_t g_dual_watch_tick_10ms;
|
||||||
volatile bool g_dual_watch_delay_down_expired = true;
|
volatile bool g_dual_watch_delay_down_expired = true;
|
||||||
|
|
||||||
volatile uint8_t g_serial_config_tick_500ms;
|
#if defined(ENABLE_UART)
|
||||||
|
volatile uint8_t g_serial_config_tick_500ms;
|
||||||
|
#endif
|
||||||
|
|
||||||
volatile bool g_next_time_slice_500ms;
|
volatile bool g_next_time_slice_500ms;
|
||||||
|
|
||||||
|
8
misc.h
8
misc.h
@ -132,7 +132,9 @@ extern const uint16_t menu_timeout_long_500ms;
|
|||||||
|
|
||||||
extern const uint16_t backlight_tx_rx_time_secs;
|
extern const uint16_t backlight_tx_rx_time_secs;
|
||||||
|
|
||||||
extern const uint8_t dtmf_rx_live_timeout_500ms;
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
|
extern const uint8_t dtmf_rx_live_timeout_500ms;
|
||||||
|
#endif
|
||||||
extern const uint8_t dtmf_rx_timeout_500ms;
|
extern const uint8_t dtmf_rx_timeout_500ms;
|
||||||
extern const uint8_t dtmf_decode_ring_500ms;
|
extern const uint8_t dtmf_decode_ring_500ms;
|
||||||
extern const uint8_t dtmf_txstop_500ms;
|
extern const uint8_t dtmf_txstop_500ms;
|
||||||
@ -197,7 +199,9 @@ extern volatile bool g_power_save_expired;
|
|||||||
extern volatile uint16_t g_dual_watch_tick_10ms;
|
extern volatile uint16_t g_dual_watch_tick_10ms;
|
||||||
extern volatile bool g_dual_watch_delay_down_expired;
|
extern volatile bool g_dual_watch_delay_down_expired;
|
||||||
|
|
||||||
extern volatile uint8_t g_serial_config_tick_500ms;
|
#if defined(ENABLE_UART)
|
||||||
|
extern volatile uint8_t g_serial_config_tick_500ms;
|
||||||
|
#endif
|
||||||
|
|
||||||
extern volatile bool g_next_time_slice_500ms;
|
extern volatile bool g_next_time_slice_500ms;
|
||||||
|
|
||||||
|
@ -139,7 +139,6 @@ void PAN_process_10ms(void)
|
|||||||
#endif
|
#endif
|
||||||
// g_single_vfo < 0 ||
|
// g_single_vfo < 0 ||
|
||||||
g_reduced_service ||
|
g_reduced_service ||
|
||||||
g_monitor_enabled ||
|
|
||||||
g_current_function == FUNCTION_POWER_SAVE ||
|
g_current_function == FUNCTION_POWER_SAVE ||
|
||||||
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 ||
|
||||||
@ -156,7 +155,7 @@ void PAN_process_10ms(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_current_function == FUNCTION_TRANSMIT)
|
if (g_current_function == FUNCTION_TRANSMIT || g_monitor_enabled)
|
||||||
{
|
{
|
||||||
panadapter_rssi_index = -1;
|
panadapter_rssi_index = -1;
|
||||||
return;
|
return;
|
||||||
|
6
radio.c
6
radio.c
@ -1114,7 +1114,11 @@ void RADIO_PrepareTX(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (!g_eeprom.config.setting.tx_enable || g_serial_config_tick_500ms > 0)
|
#if defined(ENABLE_UART)
|
||||||
|
if (!g_eeprom.config.setting.tx_enable || g_serial_config_tick_500ms > 0)
|
||||||
|
#else
|
||||||
|
if (!g_eeprom.config.setting.tx_enable)
|
||||||
|
#endif
|
||||||
{ // TX is disabled or config upload/download in progress
|
{ // TX is disabled or config upload/download in progress
|
||||||
State = VFO_STATE_TX_DISABLE;
|
State = VFO_STATE_TX_DISABLE;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,10 @@ void SystickHandler(void)
|
|||||||
g_next_time_slice_500ms = true;
|
g_next_time_slice_500ms = true;
|
||||||
|
|
||||||
DECREMENT_AND_TRIGGER(g_tx_timer_tick_500ms, g_tx_timeout_reached);
|
DECREMENT_AND_TRIGGER(g_tx_timer_tick_500ms, g_tx_timeout_reached);
|
||||||
DECREMENT(g_serial_config_tick_500ms);
|
|
||||||
|
#if defined(ENABLE_UART)
|
||||||
|
DECREMENT(g_serial_config_tick_500ms);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((g_global_sys_tick_counter & 3) == 0)
|
if ((g_global_sys_tick_counter & 3) == 0)
|
||||||
|
197
ui/main.c
197
ui/main.c
@ -53,7 +53,8 @@
|
|||||||
const int rssi_offset_band_123 = -44;
|
const int rssi_offset_band_123 = -44;
|
||||||
const int rssi_offset_band_4567 = -18;
|
const int rssi_offset_band_4567 = -18;
|
||||||
|
|
||||||
int single_vfo = -1;
|
int single_vfo = -1;
|
||||||
|
bool pan_enabled = false;
|
||||||
|
|
||||||
center_line_t g_center_line = CENTER_LINE_NONE;
|
center_line_t g_center_line = CENTER_LINE_NONE;
|
||||||
|
|
||||||
@ -395,6 +396,7 @@ void big_freq(const uint32_t frequency, const unsigned int x, const unsigned int
|
|||||||
|
|
||||||
void UI_DisplayMain_pan(const bool now)
|
void UI_DisplayMain_pan(const bool now)
|
||||||
{
|
{
|
||||||
|
const bool valid = (g_panadapter_cycles > 0 && !g_monitor_enabled && g_current_function != FUNCTION_TRANSMIT) ? true : false;
|
||||||
const unsigned int line = (g_eeprom.config.setting.tx_vfo_num == 0) ? 4 : 0;
|
const unsigned int line = (g_eeprom.config.setting.tx_vfo_num == 0) ? 4 : 0;
|
||||||
uint8_t *base_line = g_frame_buffer[line + 2];
|
uint8_t *base_line = g_frame_buffer[line + 2];
|
||||||
uint8_t max_rssi;
|
uint8_t max_rssi;
|
||||||
@ -404,21 +406,22 @@ void big_freq(const uint32_t frequency, const unsigned int x, const unsigned int
|
|||||||
|
|
||||||
if (!g_eeprom.config.setting.panadapter ||
|
if (!g_eeprom.config.setting.panadapter ||
|
||||||
!g_panadapter_enabled ||
|
!g_panadapter_enabled ||
|
||||||
g_monitor_enabled ||
|
!pan_enabled ||
|
||||||
single_vfo < 0 ||
|
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_current_function == FUNCTION_TRANSMIT ||
|
|
||||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||||
// g_dtmf_is_tx ||
|
|
||||||
g_dtmf_input_mode)
|
g_dtmf_input_mode)
|
||||||
{ // don't draw the panadapter
|
{ // don't draw the panadapter
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// auto vertical scale
|
// clear our assigned screen area
|
||||||
if (g_panadapter_cycles > 0)
|
memset(g_frame_buffer[line], 0, LCD_WIDTH * 3);
|
||||||
|
|
||||||
|
if (valid)
|
||||||
{
|
{
|
||||||
|
// auto vertical scale
|
||||||
max_rssi = g_panadapter_max_rssi;
|
max_rssi = g_panadapter_max_rssi;
|
||||||
min_rssi = g_panadapter_min_rssi;
|
min_rssi = g_panadapter_min_rssi;
|
||||||
span_rssi = max_rssi - min_rssi;
|
span_rssi = max_rssi - min_rssi;
|
||||||
@ -429,60 +432,60 @@ void big_freq(const uint32_t frequency, const unsigned int x, const unsigned int
|
|||||||
min_rssi = 255 - span_rssi;
|
min_rssi = 255 - span_rssi;
|
||||||
max_rssi = min_rssi + span_rssi;
|
max_rssi = min_rssi + span_rssi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_PANADAPTER_PEAK_FREQ
|
||||||
|
if (g_panadapter_peak_freq > 0)
|
||||||
|
{ // print the peak frequency
|
||||||
|
char str[16];
|
||||||
|
sprintf(str, "%u.%05u", g_panadapter_peak_freq / 100000, g_panadapter_peak_freq % 100000);
|
||||||
|
NUMBER_trim_trailing_zeros(str);
|
||||||
|
UI_PrintStringSmall(str, 8, 0, line + 0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear our assigned screen area
|
|
||||||
memset(g_frame_buffer[line], 0, LCD_WIDTH * 3);
|
|
||||||
|
|
||||||
#ifdef ENABLE_PANADAPTER_PEAK_FREQ
|
|
||||||
if (g_panadapter_peak_freq > 0 && g_panadapter_cycles > 0)
|
|
||||||
{ // print the peak frequency
|
|
||||||
char str[16];
|
|
||||||
sprintf(str, "%u.%05u", g_panadapter_peak_freq / 100000, g_panadapter_peak_freq % 100000);
|
|
||||||
NUMBER_trim_trailing_zeros(str);
|
|
||||||
UI_PrintStringSmall(str, 8, 0, line + 0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// draw top center vertical marker (the VFO frequency)
|
|
||||||
base_line[PANADAPTER_BINS - (LCD_WIDTH * 2)] = 0x3F;
|
|
||||||
|
|
||||||
{ // draw top & bottom horizontal dotted line
|
{ // draw top & bottom horizontal dotted line
|
||||||
const unsigned int top = PANADAPTER_BINS - (LCD_WIDTH * 2);
|
const unsigned int top = PANADAPTER_BINS - (LCD_WIDTH * 2);
|
||||||
const unsigned int bot = PANADAPTER_BINS - (LCD_WIDTH * 0);
|
const unsigned int bot = PANADAPTER_BINS - (LCD_WIDTH * 0);
|
||||||
for (i = 0; i < PANADAPTER_BINS; i += 4)
|
for (i = 0; i < PANADAPTER_BINS; i += 4)
|
||||||
{
|
{
|
||||||
// top line
|
// top line
|
||||||
base_line[top - i] |= 0x01;
|
if (i <= 4)
|
||||||
base_line[top + i] |= 0x01;
|
{
|
||||||
|
base_line[top - i] |= 1u << 0;
|
||||||
|
base_line[top + i] |= 1u << 0;
|
||||||
|
}
|
||||||
// bottom line
|
// bottom line
|
||||||
base_line[bot - i] |= 0x20;
|
base_line[bot - i] |= 1u << 6;
|
||||||
base_line[bot + i] |= 0x20;
|
base_line[bot + i] |= 1u << 6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// draw top center vertical marker (the VFO frequency)
|
||||||
|
base_line[PANADAPTER_BINS - (LCD_WIDTH * 2)] = 0x15;
|
||||||
|
|
||||||
// draw the panadapter vertical bins
|
// draw the panadapter vertical bins
|
||||||
if (g_panadapter_cycles > 0)
|
if (valid)
|
||||||
{
|
{
|
||||||
for (i = 0; i < ARRAY_SIZE(g_panadapter_rssi); i++)
|
for (i = 0; i < ARRAY_SIZE(g_panadapter_rssi); i++)
|
||||||
{
|
{
|
||||||
uint32_t pixels;
|
uint32_t pixels;
|
||||||
uint8_t rssi = g_panadapter_rssi[i];
|
uint8_t rssi = g_panadapter_rssi[i];
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
rssi = (rssi < ((-129 + 160) * 2)) ? 0 : rssi - ((-129 + 160) * 2); // min of -129dBm (S3)
|
rssi = (rssi < ((-129 + 160) * 2)) ? 0 : rssi - ((-129 + 160) * 2); // min of -129dBm (S3)
|
||||||
rssi = rssi >> 2;
|
rssi = rssi >> 2;
|
||||||
#else
|
#else
|
||||||
rssi = ((uint16_t)(rssi - min_rssi) * 21) / span_rssi; // 0 ~ 21
|
rssi = ((uint16_t)(rssi - min_rssi) * 22) / span_rssi; // 0 ~ 22
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rssi += 2; // offset from the bottom
|
rssi += 2; // offset from the bottom
|
||||||
if (rssi > 22)
|
if (rssi > 24)
|
||||||
rssi = 22; // limit peak value
|
rssi = 24; // limit peak value
|
||||||
|
|
||||||
pixels = (1u << rssi) - 1; // set the line pixels
|
pixels = (1u << rssi) - 1; // pixels
|
||||||
pixels &= 0xfffffffe; // clear the bottom line
|
pixels &= 0xfffffffe; // clear the bottom line
|
||||||
|
|
||||||
base_line[i - (LCD_WIDTH * 2)] |= bit_reverse_8(pixels >> 16);
|
base_line[i - (LCD_WIDTH * 2)] |= bit_reverse_8(pixels >> 16);
|
||||||
base_line[i - (LCD_WIDTH * 1)] |= bit_reverse_8(pixels >> 8);
|
base_line[i - (LCD_WIDTH * 1)] |= bit_reverse_8(pixels >> 8);
|
||||||
base_line[i - (LCD_WIDTH * 0)] |= bit_reverse_8(pixels >> 0);
|
base_line[i - (LCD_WIDTH * 0)] |= bit_reverse_8(pixels >> 0);
|
||||||
@ -508,23 +511,33 @@ void UI_DisplayMain(void)
|
|||||||
|
|
||||||
g_center_line = CENTER_LINE_NONE;
|
g_center_line = CENTER_LINE_NONE;
|
||||||
|
|
||||||
single_vfo = -1;
|
if (g_eeprom.config.setting.dual_watch == DUAL_WATCH_OFF && g_eeprom.config.setting.cross_vfo == CROSS_BAND_OFF)
|
||||||
|
{
|
||||||
|
single_vfo = main_vfo_num;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
single_vfo = -1;
|
||||||
|
pan_enabled = false;
|
||||||
|
|
||||||
if (g_eeprom.config.setting.dual_watch != DUAL_WATCH_OFF && g_rx_vfo_is_active)
|
if (g_eeprom.config.setting.dual_watch != DUAL_WATCH_OFF && g_rx_vfo_is_active)
|
||||||
current_vfo_num = g_rx_vfo_num; // we're currently monitoring the other VFO
|
current_vfo_num = g_rx_vfo_num; // we're currently monitoring the other VFO
|
||||||
|
}
|
||||||
|
|
||||||
// clear the screen
|
// clear the screen buffer
|
||||||
memset(g_frame_buffer, 0, sizeof(g_frame_buffer));
|
memset(g_frame_buffer, 0, sizeof(g_frame_buffer));
|
||||||
|
|
||||||
if (g_serial_config_tick_500ms > 0)
|
#if defined(ENABLE_UART)
|
||||||
{
|
if (g_serial_config_tick_500ms > 0)
|
||||||
BACKLIGHT_turn_on(5); // 5 seconds
|
{ // tell user the serial comms is in use
|
||||||
UI_PrintString("UART", 0, LCD_WIDTH, 1, 8);
|
BACKLIGHT_turn_on(5); // 5 seconds
|
||||||
UI_PrintString("CONFIG COMMS", 0, LCD_WIDTH, 3, 8);
|
UI_PrintString("UART", 0, LCD_WIDTH, 1, 8);
|
||||||
ST7565_BlitFullScreen();
|
UI_PrintString("CONFIG COMMS", 0, LCD_WIDTH, 3, 8);
|
||||||
g_center_line = CENTER_LINE_IN_USE;
|
ST7565_BlitFullScreen();
|
||||||
return;
|
g_center_line = CENTER_LINE_IN_USE;
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_KEYLOCK
|
#ifdef ENABLE_KEYLOCK
|
||||||
if (g_eeprom.config.setting.key_lock && g_keypad_locked > 0)
|
if (g_eeprom.config.setting.key_lock && g_keypad_locked > 0)
|
||||||
@ -539,20 +552,19 @@ void UI_DisplayMain(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_PANADAPTER
|
#ifdef ENABLE_PANADAPTER
|
||||||
if (g_eeprom.config.setting.dual_watch == DUAL_WATCH_OFF && g_eeprom.config.setting.cross_vfo == CROSS_BAND_OFF)
|
if (g_eeprom.config.setting.panadapter && g_panadapter_enabled && single_vfo >= 0)
|
||||||
if (g_dtmf_call_state == DTMF_CALL_STATE_NONE && !g_dtmf_is_tx && !g_dtmf_input_mode)
|
pan_enabled = true;
|
||||||
if (g_eeprom.config.setting.panadapter && g_panadapter_enabled)
|
else
|
||||||
if (!g_monitor_enabled)
|
single_vfo = -1;
|
||||||
single_vfo = g_eeprom.config.setting.tx_vfo_num;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (vfo_num = 0; vfo_num < 2; vfo_num++)
|
for (vfo_num = 0; vfo_num < 2; vfo_num++)
|
||||||
{
|
{
|
||||||
const unsigned int scrn_chan = g_eeprom.config.setting.indices.vfo[vfo_num].screen;
|
const unsigned int scrn_chan = g_eeprom.config.setting.indices.vfo[vfo_num].screen;
|
||||||
const unsigned int line = (vfo_num == 0) ? line0 : line1;
|
const unsigned int line = (vfo_num == 0) ? line0 : line1;
|
||||||
uint8_t *p_line0 = g_frame_buffer[line + 0];
|
uint8_t *p_line0 = g_frame_buffer[line + 0];
|
||||||
uint8_t *p_line1 = g_frame_buffer[line + 1];
|
uint8_t *p_line1 = g_frame_buffer[line + 1];
|
||||||
unsigned int mode = 0;
|
unsigned int mode = 0;
|
||||||
unsigned int state;
|
unsigned int state;
|
||||||
|
|
||||||
if (single_vfo >= 0 && single_vfo != vfo_num)
|
if (single_vfo >= 0 && single_vfo != vfo_num)
|
||||||
@ -618,6 +630,8 @@ void UI_DisplayMain(void)
|
|||||||
str[16] = 0;
|
str[16] = 0;
|
||||||
UI_PrintString(str, 2, 0, 2 + (vfo_num * 3), 8);
|
UI_PrintString(str, 2, 0, 2 + (vfo_num * 3), 8);
|
||||||
|
|
||||||
|
pan_enabled = false;
|
||||||
|
|
||||||
g_center_line = CENTER_LINE_IN_USE;
|
g_center_line = CENTER_LINE_IN_USE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1096,36 +1110,38 @@ void UI_DisplayMain(void)
|
|||||||
|
|
||||||
if (rx || g_current_function == FUNCTION_FOREGROUND || g_current_function == FUNCTION_POWER_SAVE)
|
if (rx || g_current_function == FUNCTION_FOREGROUND || g_current_function == FUNCTION_POWER_SAVE)
|
||||||
{
|
{
|
||||||
#if 1
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
if (g_eeprom.config.setting.dtmf_live_decoder && g_dtmf_rx_live[0] != 0)
|
#if 1
|
||||||
{ // show live DTMF decode
|
if (g_eeprom.config.setting.dtmf_live_decoder && g_dtmf_rx_live[0] != 0)
|
||||||
const unsigned int len = strlen(g_dtmf_rx_live);
|
{ // show live DTMF decode
|
||||||
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
|
const unsigned int len = strlen(g_dtmf_rx_live);
|
||||||
|
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
|
||||||
if (g_current_display_screen != DISPLAY_MAIN || g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
|
||||||
return;
|
if (g_current_display_screen != DISPLAY_MAIN || g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
||||||
|
return;
|
||||||
g_center_line = CENTER_LINE_DTMF_DEC;
|
|
||||||
|
g_center_line = CENTER_LINE_DTMF_DEC;
|
||||||
strcpy(str, "DTMF ");
|
|
||||||
strcat(str, g_dtmf_rx_live + idx);
|
strcpy(str, "DTMF ");
|
||||||
UI_PrintStringSmall(str, 2, 0, 3);
|
strcat(str, g_dtmf_rx_live + idx);
|
||||||
}
|
UI_PrintStringSmall(str, 2, 0, 3);
|
||||||
#else
|
}
|
||||||
if (g_eeprom.config.setting.dtmf_live_decoder && g_dtmf_rx_index > 0)
|
#else
|
||||||
{ // show live DTMF decode
|
if (g_eeprom.config.setting.dtmf_live_decoder && g_dtmf_rx_index > 0)
|
||||||
const unsigned int len = g_dtmf_rx_index;
|
{ // show live DTMF decode
|
||||||
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
|
const unsigned int len = g_dtmf_rx_index;
|
||||||
|
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
|
||||||
if (g_current_display_screen != DISPLAY_MAIN || g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
|
||||||
return;
|
if (g_current_display_screen != DISPLAY_MAIN || g_dtmf_call_state != DTMF_CALL_STATE_NONE)
|
||||||
|
return;
|
||||||
g_center_line = CENTER_LINE_DTMF_DEC;
|
|
||||||
|
g_center_line = CENTER_LINE_DTMF_DEC;
|
||||||
strcpy(str, "DTMF ");
|
|
||||||
strcat(str, g_dtmf_rx + idx);
|
strcpy(str, "DTMF ");
|
||||||
UI_PrintStringSmall(str, 2, 0, 3);
|
strcat(str, g_dtmf_rx + idx);
|
||||||
}
|
UI_PrintStringSmall(str, 2, 0, 3);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_SHOW_CHARGE_LEVEL
|
#ifdef ENABLE_SHOW_CHARGE_LEVEL
|
||||||
@ -1147,8 +1163,7 @@ void UI_DisplayMain(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_PANADAPTER
|
#ifdef ENABLE_PANADAPTER
|
||||||
//if (single_vfo >= 0)
|
UI_DisplayMain_pan(false);
|
||||||
UI_DisplayMain_pan(false);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ST7565_BlitFullScreen();
|
ST7565_BlitFullScreen();
|
||||||
|
14
ui/menu.c
14
ui/menu.c
@ -125,7 +125,9 @@ const t_menu_item g_menu_list[] =
|
|||||||
{"D PRE", VOICE_ID_INVALID, MENU_DTMF_PRE },
|
{"D PRE", VOICE_ID_INVALID, MENU_DTMF_PRE },
|
||||||
{"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 },
|
||||||
|
#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
|
||||||
{"PonMSG", VOICE_ID_INVALID, MENU_PON_MSG },
|
{"PonMSG", VOICE_ID_INVALID, MENU_PON_MSG },
|
||||||
{"ROGER", VOICE_ID_INVALID, MENU_ROGER_MODE },
|
{"ROGER", VOICE_ID_INVALID, MENU_ROGER_MODE },
|
||||||
{"BatVOL", VOICE_ID_INVALID, MENU_VOLTAGE }, // was "VOL"
|
{"BatVOL", VOICE_ID_INVALID, MENU_VOLTAGE }, // was "VOL"
|
||||||
@ -829,10 +831,14 @@ void UI_DisplayMenu(void)
|
|||||||
|
|
||||||
// Fallthrough
|
// Fallthrough
|
||||||
|
|
||||||
case MENU_DTMF_LIVE_DEC:
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
strcpy(str, "DTMF\nDECODE\n");
|
case MENU_DTMF_LIVE_DEC:
|
||||||
strcat(str, g_sub_menu_off_on[g_sub_menu_selection]);
|
strcpy(str, "DTMF\nDECODE\n");
|
||||||
break;
|
strcat(str, g_sub_menu_off_on[g_sub_menu_selection]);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Fallthrough
|
||||||
|
|
||||||
case MENU_STE:
|
case MENU_STE:
|
||||||
strcpy(str, "SUB TAIL\nELIMIN\n");
|
strcpy(str, "SUB TAIL\nELIMIN\n");
|
||||||
|
@ -106,7 +106,9 @@ enum
|
|||||||
MENU_DTMF_PRE,
|
MENU_DTMF_PRE,
|
||||||
MENU_DTMF_DCD,
|
MENU_DTMF_DCD,
|
||||||
MENU_DTMF_LIST,
|
MENU_DTMF_LIST,
|
||||||
|
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||||
MENU_DTMF_LIVE_DEC,
|
MENU_DTMF_LIVE_DEC,
|
||||||
|
#endif
|
||||||
#ifdef ENABLE_MDC1200
|
#ifdef ENABLE_MDC1200
|
||||||
MENU_MDC1200_MODE,
|
MENU_MDC1200_MODE,
|
||||||
MENU_MDC1200_ID,
|
MENU_MDC1200_ID,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user