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_RESET_AES_KEY := 0
|
||||
ENABLE_BIG_FREQ := 0
|
||||
ENABLE_DTMF_LIVE_DECODER := 0
|
||||
ENABLE_SHOW_FREQS_CHAN := 0
|
||||
# smaa bolf 580 B
|
||||
ENABLE_SMALL_BOLD := 1
|
||||
@ -327,6 +328,9 @@ endif
|
||||
ifeq ($(ENABLE_BIG_FREQ),1)
|
||||
CFLAGS += -DENABLE_BIG_FREQ
|
||||
endif
|
||||
ifeq ($(ENABLE_DTMF_LIVE_DECODER),1)
|
||||
CFLAGS += -DENABLE_DTMF_LIVE_DECODER
|
||||
endif
|
||||
ifeq ($(ENABLE_SHOW_FREQS_CHAN),1)
|
||||
CFLAGS += -DENABLE_SHOW_FREQS_CHAN
|
||||
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_RESET_AES_KEY := 1 '1' = reset/clear the AES key stored in the eeprom (only if it's set)
|
||||
ENABLE_BIG_FREQ := 0 big font frequencies (like original QS firmware)
|
||||
ENABLE_DTMF_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_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
|
||||
|
@ -209,8 +209,10 @@ void ACTION_Scan(bool bRestart)
|
||||
|
||||
DTMF_clear_RX();
|
||||
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
g_dtmf_rx_live_timeout = 0;
|
||||
memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
|
||||
#endif
|
||||
|
||||
RADIO_select_vfos();
|
||||
|
||||
|
45
app/app.c
45
app/app.c
@ -986,6 +986,7 @@ void APP_process_radio_interrupts(void)
|
||||
const char c = DTMF_GetCharacter(BK4819_GetDTMF_5TONE_Code());
|
||||
if (c != 0xff && g_current_function != FUNCTION_TRANSMIT)
|
||||
{
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
if (g_eeprom.config.setting.dtmf_live_decoder)
|
||||
{
|
||||
size_t len = strlen(g_dtmf_rx_live);
|
||||
@ -999,6 +1000,7 @@ void APP_process_radio_interrupts(void)
|
||||
g_dtmf_rx_live_timeout = dtmf_rx_live_timeout_500ms; // time till we delete it
|
||||
g_update_display = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
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)
|
||||
FUNCTION_Select(FUNCTION_FOREGROUND);
|
||||
|
||||
if (g_current_function == FUNCTION_TRANSMIT || g_serial_config_tick_500ms > 0)
|
||||
if (g_current_function == FUNCTION_TRANSMIT)
|
||||
return;
|
||||
|
||||
#if defined(ENABLE_UART)
|
||||
if (g_serial_config_tick_500ms > 0)
|
||||
return;
|
||||
#endif
|
||||
|
||||
// ************* go into TX mode
|
||||
|
||||
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
||||
@ -1303,10 +1310,14 @@ void APP_process_keys(void)
|
||||
if (ptt_pressed)
|
||||
{ // PTT pressed
|
||||
|
||||
if (!g_ptt_is_pressed && g_eeprom.config.setting.tx_enable && g_current_function != FUNCTION_TRANSMIT)
|
||||
{
|
||||
#if defined(ENABLE_UART)
|
||||
if (g_serial_config_tick_500ms == 0)
|
||||
#endif
|
||||
{
|
||||
#ifdef ENABLE_AIRCOPY
|
||||
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)
|
||||
if (g_current_display_screen != DISPLAY_AIRCOPY)
|
||||
#endif
|
||||
{
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
@ -1326,10 +1337,16 @@ void APP_process_keys(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // PTT released
|
||||
|
||||
#if defined(ENABLE_UART)
|
||||
if (g_ptt_is_pressed || g_serial_config_tick_500ms > 0)
|
||||
#else
|
||||
if (g_ptt_is_pressed)
|
||||
#endif
|
||||
{
|
||||
// if (g_ptt_debounce > 0)
|
||||
{
|
||||
@ -1357,6 +1374,7 @@ void APP_process_keys(void)
|
||||
// scan the hardware keys
|
||||
key = KEYBOARD_Poll();
|
||||
|
||||
#if defined(ENABLE_UART)
|
||||
if (g_serial_config_tick_500ms > 0)
|
||||
{ // config upload/download in progress
|
||||
g_key_debounce_press = 0;
|
||||
@ -1366,6 +1384,7 @@ void APP_process_keys(void)
|
||||
g_fkey_pressed = false;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (key == KEY_INVALID || (g_key_prev != KEY_INVALID && key != g_key_prev))
|
||||
{ // 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 defined(ENABLE_UART)
|
||||
if (g_serial_config_tick_500ms == 0)
|
||||
#endif
|
||||
AUDIO_PlayBeep(g_beep_to_play);
|
||||
g_beep_to_play = BEEP_NONE;
|
||||
}
|
||||
@ -1995,10 +2016,10 @@ void APP_time_slice_500ms(void)
|
||||
if (--g_keypad_locked == 0)
|
||||
g_update_display = true;
|
||||
|
||||
#if defined(ENABLE_UART)
|
||||
if (g_serial_config_tick_500ms > 0)
|
||||
{ // config upload/download is running
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (g_current_function == FUNCTION_TRANSMIT)
|
||||
{
|
||||
@ -2039,6 +2060,7 @@ void APP_time_slice_500ms(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
if (g_dtmf_rx_live_timeout > 0)
|
||||
{
|
||||
#ifdef ENABLE_RX_SIGNAL_BAR
|
||||
@ -2056,6 +2078,7 @@ void APP_time_slice_500ms(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (g_menu_tick_10ms > 0)
|
||||
if (--g_menu_tick_10ms == 0)
|
||||
@ -2412,7 +2435,11 @@ void APP_time_slice_10ms(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_UART)
|
||||
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
|
||||
|
||||
BK4819_stop_tones(true);
|
||||
@ -2450,7 +2477,11 @@ void APP_time_slice_10ms(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_UART)
|
||||
if (g_reduced_service || g_serial_config_tick_500ms > 0)
|
||||
#else
|
||||
if (g_reduced_service)
|
||||
#endif
|
||||
{
|
||||
if (g_current_function == FUNCTION_TRANSMIT)
|
||||
g_tx_timeout_reached = true;
|
||||
@ -2659,6 +2690,7 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const
|
||||
if (Key == KEY_EXIT && key_held && key_pressed)
|
||||
{ // exit key held pressed
|
||||
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
// clear the live DTMF decoder
|
||||
if (g_dtmf_rx_live[0] != 0)
|
||||
{
|
||||
@ -2666,6 +2698,7 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const
|
||||
g_dtmf_rx_live_timeout = 0;
|
||||
g_update_display = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
// cancel user input
|
||||
APP_cancel_user_input_modes();
|
||||
|
@ -46,8 +46,10 @@ uint8_t g_dtmf_rx_index;
|
||||
uint8_t g_dtmf_rx_timeout;
|
||||
bool g_dtmf_rx_pending;
|
||||
|
||||
char g_dtmf_rx_live[20];
|
||||
uint8_t g_dtmf_rx_live_timeout;
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
char g_dtmf_rx_live[20];
|
||||
uint8_t g_dtmf_rx_live_timeout;
|
||||
#endif
|
||||
|
||||
bool g_dtmf_is_contact_valid;
|
||||
char g_dtmf_id[4];
|
||||
|
@ -77,8 +77,10 @@ extern uint8_t g_dtmf_rx_index;
|
||||
extern uint8_t g_dtmf_rx_timeout;
|
||||
extern bool g_dtmf_rx_pending;
|
||||
|
||||
extern char g_dtmf_rx_live[20];
|
||||
extern uint8_t g_dtmf_rx_live_timeout;
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
extern char g_dtmf_rx_live[20];
|
||||
extern uint8_t g_dtmf_rx_live_timeout;
|
||||
#endif
|
||||
|
||||
extern bool g_dtmf_is_contact_valid;
|
||||
extern char g_dtmf_id[4];
|
||||
|
@ -99,7 +99,11 @@ void GENERIC_Key_PTT(bool key_pressed)
|
||||
{
|
||||
g_input_box_index = 0;
|
||||
|
||||
#if defined(ENABLE_UART)
|
||||
if (!key_pressed || g_serial_config_tick_500ms > 0)
|
||||
#else
|
||||
if (!key_pressed)
|
||||
#endif
|
||||
{ // PTT released
|
||||
|
||||
if (g_current_function == FUNCTION_TRANSMIT)
|
||||
|
@ -264,7 +264,9 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
||||
case MENU_STE:
|
||||
case MENU_DTMF_ST:
|
||||
case MENU_DTMF_DCD:
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
case MENU_DTMF_LIVE_DEC:
|
||||
#endif
|
||||
*pMin = 0;
|
||||
*pMax = ARRAY_SIZE(g_sub_menu_off_on) - 1;
|
||||
break;
|
||||
@ -771,6 +773,7 @@ void MENU_AcceptSetting(void)
|
||||
g_request_save_channel = 1;
|
||||
return;
|
||||
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
case MENU_DTMF_LIVE_DEC:
|
||||
g_eeprom.config.setting.dtmf_live_decoder = g_sub_menu_selection;
|
||||
g_dtmf_rx_live_timeout = 0;
|
||||
@ -780,6 +783,7 @@ void MENU_AcceptSetting(void)
|
||||
g_flag_reconfigure_vfos = true;
|
||||
g_update_status = true;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case MENU_DTMF_LIST:
|
||||
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;
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
case MENU_DTMF_LIVE_DEC:
|
||||
g_sub_menu_selection = g_eeprom.config.setting.dtmf_live_decoder;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case MENU_PON_MSG:
|
||||
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;
|
||||
}
|
||||
else
|
||||
{
|
||||
{ // save the new power level
|
||||
g_tx_vfo->channel.tx_power_user = g_edit_index;
|
||||
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
|
||||
DTMF_clear_RX();
|
||||
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
// clear the DTMF RX live decoder buffer
|
||||
g_dtmf_rx_live_timeout = 0;
|
||||
memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
// 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 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_decode_ring_500ms = 15000 / 500; // 15 seconds .. time we sound the ringing for
|
||||
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 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;
|
||||
|
||||
|
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 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_decode_ring_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 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;
|
||||
|
||||
|
@ -139,7 +139,6 @@ void PAN_process_10ms(void)
|
||||
#endif
|
||||
// g_single_vfo < 0 ||
|
||||
g_reduced_service ||
|
||||
g_monitor_enabled ||
|
||||
g_current_function == FUNCTION_POWER_SAVE ||
|
||||
g_current_display_screen == DISPLAY_SEARCH ||
|
||||
g_css_scan_mode != CSS_SCAN_MODE_OFF ||
|
||||
@ -156,7 +155,7 @@ void PAN_process_10ms(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (g_current_function == FUNCTION_TRANSMIT)
|
||||
if (g_current_function == FUNCTION_TRANSMIT || g_monitor_enabled)
|
||||
{
|
||||
panadapter_rssi_index = -1;
|
||||
return;
|
||||
|
4
radio.c
4
radio.c
@ -1114,7 +1114,11 @@ void RADIO_PrepareTX(void)
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#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
|
||||
State = VFO_STATE_TX_DISABLE;
|
||||
}
|
||||
|
@ -58,7 +58,10 @@ void SystickHandler(void)
|
||||
g_next_time_slice_500ms = true;
|
||||
|
||||
DECREMENT_AND_TRIGGER(g_tx_timer_tick_500ms, g_tx_timeout_reached);
|
||||
|
||||
#if defined(ENABLE_UART)
|
||||
DECREMENT(g_serial_config_tick_500ms);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((g_global_sys_tick_counter & 3) == 0)
|
||||
|
77
ui/main.c
77
ui/main.c
@ -54,6 +54,7 @@ const int rssi_offset_band_123 = -44;
|
||||
const int rssi_offset_band_4567 = -18;
|
||||
|
||||
int single_vfo = -1;
|
||||
bool pan_enabled = false;
|
||||
|
||||
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)
|
||||
{
|
||||
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;
|
||||
uint8_t *base_line = g_frame_buffer[line + 2];
|
||||
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 ||
|
||||
!g_panadapter_enabled ||
|
||||
g_monitor_enabled ||
|
||||
single_vfo < 0 ||
|
||||
!pan_enabled ||
|
||||
g_reduced_service ||
|
||||
g_current_display_screen != DISPLAY_MAIN ||
|
||||
g_current_function == FUNCTION_POWER_SAVE ||
|
||||
// g_current_function == FUNCTION_TRANSMIT ||
|
||||
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
// g_dtmf_is_tx ||
|
||||
g_dtmf_input_mode)
|
||||
{ // don't draw the panadapter
|
||||
return;
|
||||
}
|
||||
|
||||
// auto vertical scale
|
||||
if (g_panadapter_cycles > 0)
|
||||
// clear our assigned screen area
|
||||
memset(g_frame_buffer[line], 0, LCD_WIDTH * 3);
|
||||
|
||||
if (valid)
|
||||
{
|
||||
// auto vertical scale
|
||||
max_rssi = g_panadapter_max_rssi;
|
||||
min_rssi = g_panadapter_min_rssi;
|
||||
span_rssi = max_rssi - min_rssi;
|
||||
@ -429,13 +432,9 @@ void big_freq(const uint32_t frequency, const unsigned int x, const unsigned int
|
||||
min_rssi = 255 - span_rssi;
|
||||
max_rssi = min_rssi + span_rssi;
|
||||
}
|
||||
}
|
||||
|
||||
// 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)
|
||||
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);
|
||||
@ -443,9 +442,7 @@ void big_freq(const uint32_t frequency, const unsigned int x, const unsigned int
|
||||
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
|
||||
const unsigned int top = PANADAPTER_BINS - (LCD_WIDTH * 2);
|
||||
@ -453,16 +450,22 @@ void big_freq(const uint32_t frequency, const unsigned int x, const unsigned int
|
||||
for (i = 0; i < PANADAPTER_BINS; i += 4)
|
||||
{
|
||||
// top line
|
||||
base_line[top - i] |= 0x01;
|
||||
base_line[top + i] |= 0x01;
|
||||
if (i <= 4)
|
||||
{
|
||||
base_line[top - i] |= 1u << 0;
|
||||
base_line[top + i] |= 1u << 0;
|
||||
}
|
||||
// bottom line
|
||||
base_line[bot - i] |= 0x20;
|
||||
base_line[bot + i] |= 0x20;
|
||||
base_line[bot - i] |= 1u << 6;
|
||||
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
|
||||
if (g_panadapter_cycles > 0)
|
||||
if (valid)
|
||||
{
|
||||
for (i = 0; i < ARRAY_SIZE(g_panadapter_rssi); i++)
|
||||
{
|
||||
@ -473,14 +476,14 @@ void big_freq(const uint32_t frequency, const unsigned int x, const unsigned int
|
||||
rssi = (rssi < ((-129 + 160) * 2)) ? 0 : rssi - ((-129 + 160) * 2); // min of -129dBm (S3)
|
||||
rssi = rssi >> 2;
|
||||
#else
|
||||
rssi = ((uint16_t)(rssi - min_rssi) * 21) / span_rssi; // 0 ~ 21
|
||||
rssi = ((uint16_t)(rssi - min_rssi) * 22) / span_rssi; // 0 ~ 22
|
||||
#endif
|
||||
|
||||
rssi += 2; // offset from the bottom
|
||||
if (rssi > 22)
|
||||
rssi = 22; // limit peak value
|
||||
if (rssi > 24)
|
||||
rssi = 24; // limit peak value
|
||||
|
||||
pixels = (1u << rssi) - 1; // set the line pixels
|
||||
pixels = (1u << rssi) - 1; // pixels
|
||||
pixels &= 0xfffffffe; // clear the bottom line
|
||||
|
||||
base_line[i - (LCD_WIDTH * 2)] |= bit_reverse_8(pixels >> 16);
|
||||
@ -508,16 +511,25 @@ void UI_DisplayMain(void)
|
||||
|
||||
g_center_line = CENTER_LINE_NONE;
|
||||
|
||||
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)
|
||||
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));
|
||||
|
||||
#if defined(ENABLE_UART)
|
||||
if (g_serial_config_tick_500ms > 0)
|
||||
{
|
||||
{ // tell user the serial comms is in use
|
||||
BACKLIGHT_turn_on(5); // 5 seconds
|
||||
UI_PrintString("UART", 0, LCD_WIDTH, 1, 8);
|
||||
UI_PrintString("CONFIG COMMS", 0, LCD_WIDTH, 3, 8);
|
||||
@ -525,6 +537,7 @@ void UI_DisplayMain(void)
|
||||
g_center_line = CENTER_LINE_IN_USE;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_KEYLOCK
|
||||
if (g_eeprom.config.setting.key_lock && g_keypad_locked > 0)
|
||||
@ -539,11 +552,10 @@ void UI_DisplayMain(void)
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_PANADAPTER
|
||||
if (g_eeprom.config.setting.dual_watch == DUAL_WATCH_OFF && g_eeprom.config.setting.cross_vfo == CROSS_BAND_OFF)
|
||||
if (g_dtmf_call_state == DTMF_CALL_STATE_NONE && !g_dtmf_is_tx && !g_dtmf_input_mode)
|
||||
if (g_eeprom.config.setting.panadapter && g_panadapter_enabled)
|
||||
if (!g_monitor_enabled)
|
||||
single_vfo = g_eeprom.config.setting.tx_vfo_num;
|
||||
if (g_eeprom.config.setting.panadapter && g_panadapter_enabled && single_vfo >= 0)
|
||||
pan_enabled = true;
|
||||
else
|
||||
single_vfo = -1;
|
||||
#endif
|
||||
|
||||
for (vfo_num = 0; vfo_num < 2; vfo_num++)
|
||||
@ -618,6 +630,8 @@ void UI_DisplayMain(void)
|
||||
str[16] = 0;
|
||||
UI_PrintString(str, 2, 0, 2 + (vfo_num * 3), 8);
|
||||
|
||||
pan_enabled = false;
|
||||
|
||||
g_center_line = CENTER_LINE_IN_USE;
|
||||
continue;
|
||||
}
|
||||
@ -1096,6 +1110,7 @@ void UI_DisplayMain(void)
|
||||
|
||||
if (rx || g_current_function == FUNCTION_FOREGROUND || g_current_function == FUNCTION_POWER_SAVE)
|
||||
{
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
#if 1
|
||||
if (g_eeprom.config.setting.dtmf_live_decoder && g_dtmf_rx_live[0] != 0)
|
||||
{ // show live DTMF decode
|
||||
@ -1127,6 +1142,7 @@ void UI_DisplayMain(void)
|
||||
UI_PrintStringSmall(str, 2, 0, 3);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_SHOW_CHARGE_LEVEL
|
||||
else
|
||||
@ -1147,7 +1163,6 @@ void UI_DisplayMain(void)
|
||||
}
|
||||
|
||||
#ifdef ENABLE_PANADAPTER
|
||||
//if (single_vfo >= 0)
|
||||
UI_DisplayMain_pan(false);
|
||||
#endif
|
||||
|
||||
|
@ -125,7 +125,9 @@ const t_menu_item g_menu_list[] =
|
||||
{"D PRE", VOICE_ID_INVALID, MENU_DTMF_PRE },
|
||||
{"D DCD", VOICE_ID_INVALID, MENU_DTMF_DCD },
|
||||
{"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
|
||||
#endif
|
||||
{"PonMSG", VOICE_ID_INVALID, MENU_PON_MSG },
|
||||
{"ROGER", VOICE_ID_INVALID, MENU_ROGER_MODE },
|
||||
{"BatVOL", VOICE_ID_INVALID, MENU_VOLTAGE }, // was "VOL"
|
||||
@ -829,10 +831,14 @@ void UI_DisplayMenu(void)
|
||||
|
||||
// Fallthrough
|
||||
|
||||
#ifdef 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]);
|
||||
break;
|
||||
#endif
|
||||
|
||||
// Fallthrough
|
||||
|
||||
case MENU_STE:
|
||||
strcpy(str, "SUB TAIL\nELIMIN\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user