0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-05-18 16:01:18 +03:00

single VFO display update

This commit is contained in:
OneOfEleven 2023-12-01 10:34:53 +00:00
parent 9819afa405
commit ff2248b287
10 changed files with 271 additions and 290 deletions

View File

@ -36,6 +36,7 @@ ENABLE_TX1750 := 0
ENABLE_MDC1200 := 0 ENABLE_MDC1200 := 0
ENABLE_MDC1200_SHOW_OP_ARG := 1 ENABLE_MDC1200_SHOW_OP_ARG := 1
ENABLE_MDC1200_SIDE_BEEP := 1 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
@ -49,9 +50,9 @@ ENABLE_SMALLEST_FONT := 0
ENABLE_TRIM_TRAILING_ZEROS := 0 ENABLE_TRIM_TRAILING_ZEROS := 0
ENABLE_WIDE_RX := 1 ENABLE_WIDE_RX := 1
ENABLE_TX_WHEN_AM := 0 ENABLE_TX_WHEN_AM := 0
# Freq calibration 188 B # Frequency calibration 188 B
ENABLE_F_CAL_MENU := 0 ENABLE_F_CAL_MENU := 0
ENABLE_FM_DEV_CAL_MENU := 1 ENABLE_FM_DEV_CAL_MENU := 0
ENABLE_TX_UNLOCK_MENU := 0 ENABLE_TX_UNLOCK_MENU := 0
#ENABLE_TX_POWER_CAL_MENU := 0 #ENABLE_TX_POWER_CAL_MENU := 0
ENABLE_TX_POWER_FIX := 1 ENABLE_TX_POWER_FIX := 1
@ -76,8 +77,6 @@ ENABLE_SQUELCH_MORE_SENSITIVE := 1
ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1 ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1
ENABLE_FASTER_CHANNEL_SCAN := 1 ENABLE_FASTER_CHANNEL_SCAN := 1
ENABLE_COPY_CHAN_TO_VFO_TO_CHAN := 1 ENABLE_COPY_CHAN_TO_VFO_TO_CHAN := 1
# Rx Signal Bar 400 B
ENABLE_RX_SIGNAL_BAR := 1
# Tx Audio Bar 300 B # Tx Audio Bar 300 B
ENABLE_TX_AUDIO_BAR := 0 ENABLE_TX_AUDIO_BAR := 0
# Side Button Menu 300 B # Side Button Menu 300 B
@ -462,9 +461,6 @@ endif
ifeq ($(ENABLE_backlight_ON_RX),1) ifeq ($(ENABLE_backlight_ON_RX),1)
CFLAGS += -DENABLE_backlight_ON_RX CFLAGS += -DENABLE_backlight_ON_RX
endif endif
ifeq ($(ENABLE_RX_SIGNAL_BAR),1)
CFLAGS += -DENABLE_RX_SIGNAL_BAR
endif
ifeq ($(ENABLE_TX_AUDIO_BAR),1) ifeq ($(ENABLE_TX_AUDIO_BAR),1)
CFLAGS += -DENABLE_TX_AUDIO_BAR CFLAGS += -DENABLE_TX_AUDIO_BAR
endif endif

View File

@ -94,7 +94,6 @@ ENABLE_SQUELCH_MORE_SENSITIVE := 1 make squelch levels a little bit mor
ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1 open the squelch when holding down UP or DN buttons when in frequency mode ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1 open the squelch when holding down UP or DN buttons when in frequency mode
ENABLE_FASTER_CHANNEL_SCAN := 1 increase the channel scan speed, but also make the squelch more twitchy ENABLE_FASTER_CHANNEL_SCAN := 1 increase the channel scan speed, but also make the squelch more twitchy
ENABLE_COPY_CHAN_TO_VFO_TO_CHAN := 1 long press M, copy channel to VFO, or VFO to channel ENABLE_COPY_CHAN_TO_VFO_TO_CHAN := 1 long press M, copy channel to VFO, or VFO to channel
ENABLE_RX_SIGNAL_BAR := 1 enable a menu option for showing an RSSI bar graph
ENABLE_TX_AUDIO_BAR := 1 enable a menu option for showing a TX audio level bar ENABLE_TX_AUDIO_BAR := 1 enable a menu option for showing a TX audio level bar
ENABLE_SIDE_BUTT_MENU := 1 enable menu option for configuring the programmable side buttons ENABLE_SIDE_BUTT_MENU := 1 enable menu option for configuring the programmable side buttons
ENABLE_KEYLOCK := 1 enable keylock menu option + keylock code ENABLE_KEYLOCK := 1 enable keylock menu option + keylock code

View File

@ -2085,18 +2085,15 @@ void APP_time_slice_500ms(void)
#ifdef ENABLE_DTMF_LIVE_DECODER #ifdef ENABLE_DTMF_LIVE_DECODER
if (g_dtmf_rx_live_timeout > 0) if (g_dtmf_rx_live_timeout > 0)
{ {
#ifdef ENABLE_RX_SIGNAL_BAR if (g_center_line == CENTER_LINE_DTMF_DEC ||
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
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)
{ {
if (--g_dtmf_rx_live_timeout == 0) if (g_dtmf_rx_live[0] != 0)
{ {
if (g_dtmf_rx_live[0] != 0) memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
{ g_update_display = true;
memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
g_update_display = true;
}
} }
} }
} }

View File

@ -239,9 +239,7 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
#ifdef ENABLE_TX_AUDIO_BAR #ifdef ENABLE_TX_AUDIO_BAR
case MENU_TX_BAR: case MENU_TX_BAR:
#endif #endif
#ifdef ENABLE_RX_SIGNAL_BAR case MENU_RX_BAR:
case MENU_RX_BAR:
#endif
case MENU_BUSY_CHAN_LOCK: case MENU_BUSY_CHAN_LOCK:
case MENU_BEEP: case MENU_BEEP:
#ifdef ENABLE_KEYLOCK #ifdef ENABLE_KEYLOCK
@ -706,11 +704,9 @@ void MENU_AcceptSetting(void)
break; break;
#endif #endif
#ifdef ENABLE_RX_SIGNAL_BAR case MENU_RX_BAR:
case MENU_RX_BAR: g_eeprom.config.setting.enable_rssi_bar = g_sub_menu_selection;
g_eeprom.config.setting.enable_rssi_bar = g_sub_menu_selection; break;
break;
#endif
case MENU_COMPAND: case MENU_COMPAND:
g_tx_vfo->channel.compand = g_sub_menu_selection; g_tx_vfo->channel.compand = g_sub_menu_selection;
@ -1223,11 +1219,9 @@ void MENU_ShowCurrentSetting(void)
break; break;
#endif #endif
#ifdef ENABLE_RX_SIGNAL_BAR case MENU_RX_BAR:
case MENU_RX_BAR: g_sub_menu_selection = g_eeprom.config.setting.enable_rssi_bar;
g_sub_menu_selection = g_eeprom.config.setting.enable_rssi_bar; break;
break;
#endif
case MENU_COMPAND: case MENU_COMPAND:
g_sub_menu_selection = g_tx_vfo->channel.compand; g_sub_menu_selection = g_tx_vfo->channel.compand;

Binary file not shown.

Binary file not shown.

View File

@ -315,11 +315,8 @@ void SETTINGS_read_eeprom(void)
// g_eeprom.config.setting.enable_tx_470 = (g_eeprom.config.setting.enable_tx_470 < 2) ? g_eeprom.config.setting.enable_tx_470 : 0; // g_eeprom.config.setting.enable_tx_470 = (g_eeprom.config.setting.enable_tx_470 < 2) ? g_eeprom.config.setting.enable_tx_470 : 0;
// g_eeprom.config.setting.enable_350 = (g_eeprom.config.setting.enable_350 < 2) ? g_eeprom.config.setting.enable_350 : 1; // g_eeprom.config.setting.enable_350 = (g_eeprom.config.setting.enable_350 < 2) ? g_eeprom.config.setting.enable_350 : 1;
// g_eeprom.config.setting.enable_scrambler = (g_eeprom.config.setting.enable_scrambler & (1u << 0)) ? 1 : 0; // g_eeprom.config.setting.enable_scrambler = (g_eeprom.config.setting.enable_scrambler & (1u << 0)) ? 1 : 0;
#ifdef ENABLE_RX_SIGNAL_BAR // g_eeprom.config.setting.enable_rssi_bar = (Data[6] & (1u << 1)) ? true : false;
// g_eeprom.config.setting.enable_rssi_bar = (Data[6] & (1u << 1)) ? true : false;
#else
g_eeprom.config.setting.enable_rssi_bar = 0;
#endif
// g_eeprom.config.setting.tx_enable = (Data[7] & (1u << 0)) ? true : false; // g_eeprom.config.setting.tx_enable = (Data[7] & (1u << 0)) ? true : false;
// g_eeprom.config.setting.dtmf_live_decoder = (Data[7] & (1u << 1)) ? true : false; // g_eeprom.config.setting.dtmf_live_decoder = (Data[7] & (1u << 1)) ? true : false;
g_eeprom.config.setting.battery_text = (g_eeprom.config.setting.battery_text < 3) ? g_eeprom.config.setting.battery_text : 2; g_eeprom.config.setting.battery_text = (g_eeprom.config.setting.battery_text < 3) ? g_eeprom.config.setting.battery_text : 2;

494
ui/main.c
View File

@ -168,125 +168,119 @@ void draw_bar(uint8_t *line, const int len, const int max_width)
} }
#endif #endif
#ifdef ENABLE_RX_SIGNAL_BAR bool UI_DisplayRSSIBar(const int rssi, const unsigned int glitch, const unsigned int noise, const bool now)
bool UI_DisplayRSSIBar(const int rssi, const unsigned int glitch, const unsigned int noise, const bool now) {
if (g_eeprom.config.setting.enable_rssi_bar)
{ {
if (g_eeprom.config.setting.enable_rssi_bar) #ifdef SHOW_RX_TEST_VALUES
{
#ifdef SHOW_RX_TEST_VALUES
const unsigned int line = 3; const unsigned int line = 3;
char str[22]; char str[22];
#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)
return false; // display is in use
#endif
if (g_current_function == FUNCTION_TRANSMIT || g_current_display_screen != DISPLAY_MAIN || g_dtmf_call_state != DTMF_CALL_STATE_NONE)
return false; // display is in use return false; // display is in use
#endif
if (now) if (g_current_function == FUNCTION_TRANSMIT || g_current_display_screen != DISPLAY_MAIN || g_dtmf_call_state != DTMF_CALL_STATE_NONE)
memset(g_frame_buffer[line], 0, LCD_WIDTH); return false; // display is in use
sprintf(str, "r %3d g %3u n %3u", rssi, glitch, noise); if (now)
UI_PrintStringSmall(str, 2, 0, line);
if (now)
ST7565_BlitFullScreen();
return true;
#else
(void)glitch; // TODO:
(void)noise;
// const int s0_dBm = -127; // S0 .. base level
const int s0_dBm = -147; // S0 .. base level
const int s9_dBm = s0_dBm + (6 * 9); // S9 .. 6dB/S-Point
const int bar_max_dBm = s9_dBm + 80; // S9+80dB
// const int bar_min_dBm = s0_dBm + (6 * 0); // S0
const int bar_min_dBm = s0_dBm + (6 * 2); // S2
// ************
const unsigned int txt_width = 7 * 8; // 8 text chars
const unsigned int bar_x = 2 + txt_width + 4; // X coord of bar graph
const unsigned int bar_width = LCD_WIDTH - 1 - bar_x;
const int rssi_dBm = (rssi / 2) - 160;
const int clamped_dBm = (rssi_dBm <= bar_min_dBm) ? bar_min_dBm : (rssi_dBm >= bar_max_dBm) ? bar_max_dBm : rssi_dBm;
const unsigned int bar_range_dB = bar_max_dBm - bar_min_dBm;
const unsigned int len = ((clamped_dBm - bar_min_dBm) * bar_width) / bar_range_dB;
#ifdef ENABLE_SINGLE_VFO_CHAN
const unsigned int line = (single_vfo >= 0 && !pan_enabled) ? 6 : 3;
#else
const unsigned int line = 3;
#endif
char s[16];
#ifdef ENABLE_KEYLOCK
if (g_eeprom.config.setting.key_lock && g_keypad_locked > 0)
return false; // display is in use
#endif
if (g_current_function == FUNCTION_TRANSMIT ||
g_current_display_screen != DISPLAY_MAIN ||
g_dtmf_call_state != DTMF_CALL_STATE_NONE)
return false; // display is in use
// clear the line
memset(g_frame_buffer[line], 0, LCD_WIDTH); memset(g_frame_buffer[line], 0, LCD_WIDTH);
if (rssi_dBm >= (s9_dBm + 6)) sprintf(str, "r %3d g %3u n %3u", rssi, glitch, noise);
{ // S9+XXdB, 1dB increment UI_PrintStringSmall(str, 2, 0, line);
const char *fmt[] = {"%3d 9+%u ", "%3d 9+%2u "};
const unsigned int s9_dB = ((rssi_dBm - s9_dBm) <= 99) ? rssi_dBm - s9_dBm : 99;
sprintf(s, (s9_dB < 10) ? fmt[0] : fmt[1], rssi_dBm, s9_dB);
}
else
{ // S0 ~ S9, 6dB per S-point
const unsigned int s_level = (rssi_dBm >= s0_dBm) ? (rssi_dBm - s0_dBm) / 6 : 0;
sprintf(s, "%4d S%u ", rssi_dBm, s_level);
}
UI_PrintStringSmall(s, 2, 0, line);
draw_bar(g_frame_buffer[line] + bar_x, len, bar_width); if (now)
ST7565_BlitFullScreen();
if (now) return true;
ST7565_BlitFullScreen();
return true; #else
(void)glitch; // TODO:
(void)noise;
//const int s0_dBm = -127; // S0 .. base level
const int s0_dBm = -147; // S0 .. base level
const int s9_dBm = s0_dBm + (6 * 9); // S9 .. 6dB/S-Point
const int bar_max_dBm = s9_dBm + 80; // S9+80dB
const int bar_min_dBm = s0_dBm + (6 * 0); // S0
//const int bar_min_dBm = s0_dBm + (6 * 2); // S2
// ************
const unsigned int txt_width = 7 * 8; // 8 text chars
const unsigned int bar_x = 2 + txt_width + 4; // X coord of bar graph
const unsigned int bar_width = LCD_WIDTH - 1 - bar_x;
const int rssi_dBm = (rssi / 2) - 160;
const int clamped_dBm = (rssi_dBm <= bar_min_dBm) ? bar_min_dBm : (rssi_dBm >= bar_max_dBm) ? bar_max_dBm : rssi_dBm;
const unsigned int bar_range_dB = bar_max_dBm - bar_min_dBm;
const unsigned int len = ((clamped_dBm - bar_min_dBm) * bar_width) / bar_range_dB;
#ifdef ENABLE_SINGLE_VFO_CHAN
const unsigned int line = (single_vfo >= 0 && !pan_enabled) ? 6 : 3;
#else
const unsigned int line = 3;
#endif #endif
}
return false; char s[16];
#ifdef ENABLE_KEYLOCK
if (g_eeprom.config.setting.key_lock && g_keypad_locked > 0)
return false; // display is in use
#endif
if (g_current_function == FUNCTION_TRANSMIT ||
g_current_display_screen != DISPLAY_MAIN ||
g_dtmf_call_state != DTMF_CALL_STATE_NONE)
return false; // display is in use
// clear the line
memset(g_frame_buffer[line], 0, LCD_WIDTH);
if (rssi_dBm >= (s9_dBm + 6))
{ // S9+XXdB, 1dB increment
const char *fmt[] = {"%3d 9+%u ", "%3d 9+%2u "};
const unsigned int s9_dB = ((rssi_dBm - s9_dBm) <= 99) ? rssi_dBm - s9_dBm : 99;
sprintf(s, (s9_dB < 10) ? fmt[0] : fmt[1], rssi_dBm, s9_dB);
}
else
{ // S0 ~ S9, 6dB per S-point
const unsigned int s_level = (rssi_dBm >= s0_dBm) ? (rssi_dBm - s0_dBm) / 6 : 0;
sprintf(s, "%4d S%u ", rssi_dBm, s_level);
}
UI_PrintStringSmall(s, 2, 0, line);
draw_bar(g_frame_buffer[line] + bar_x, len, bar_width);
if (now)
ST7565_BlitFullScreen();
return true;
#endif
} }
#endif
return false;
}
void UI_update_rssi(const int rssi, const unsigned int glitch, const unsigned int noise, const unsigned int vfo) void UI_update_rssi(const int rssi, const unsigned int glitch, const unsigned int noise, const unsigned int vfo)
{ {
#ifdef ENABLE_RX_SIGNAL_BAR (void)glitch;
(void)noise;
if (g_center_line == CENTER_LINE_RSSI) if (g_center_line == CENTER_LINE_RSSI)
{ // large RSSI dBm, S-point, bar level { // large RSSI dBm, S-point, bar level
const int rssi_level = (g_tx_vfo->channel_attributes.band < 3) ? rssi + rssi_offset_band_123 : rssi + rssi_offset_band_4567; const int rssi_level = (g_tx_vfo->channel_attributes.band < 3) ? rssi + rssi_offset_band_123 : rssi + rssi_offset_band_4567;
//if (g_current_function == FUNCTION_RECEIVE && g_squelch_open) //if (g_current_function == FUNCTION_RECEIVE && g_squelch_open)
if (g_current_function == FUNCTION_RECEIVE) if (g_current_function == FUNCTION_RECEIVE)
UI_DisplayRSSIBar(rssi_level, glitch, noise, true); UI_DisplayRSSIBar(rssi_level, glitch, noise, true);
} }
#else
(void)glitch;
(void)noise;
#endif
#ifdef ENABLE_SINGLE_VFO_CHAN #ifdef ENABLE_SINGLE_VFO_CHAN
if (single_vfo >= 0 && !pan_enabled) if (single_vfo >= 0 && !pan_enabled)
@ -580,16 +574,14 @@ void UI_DisplayCenterLine(void)
else else
#endif #endif
#ifdef ENABLE_RX_SIGNAL_BAR // show the RX RSSI dBm, S-point and signal strength bar graph
// show the RX RSSI dBm, S-point and signal strength bar graph if (rx && g_eeprom.config.setting.enable_rssi_bar)
if (rx && g_eeprom.config.setting.enable_rssi_bar) {
{ const int rssi_level = (g_tx_vfo->channel_attributes.band < 3) ? g_current_rssi[g_rx_vfo_num] + rssi_offset_band_123 : g_current_rssi[g_rx_vfo_num] + rssi_offset_band_4567;
const int rssi_level = (g_tx_vfo->channel_attributes.band < 3) ? g_current_rssi[g_rx_vfo_num] + rssi_offset_band_123 : g_current_rssi[g_rx_vfo_num] + rssi_offset_band_4567; g_center_line = CENTER_LINE_RSSI;
g_center_line = CENTER_LINE_RSSI; UI_DisplayRSSIBar(rssi_level, g_current_glitch[g_rx_vfo_num], g_current_noise[g_rx_vfo_num], false);
UI_DisplayRSSIBar(rssi_level, g_current_glitch[g_rx_vfo_num], g_current_noise[g_rx_vfo_num], false); }
} else
else
#endif
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)
{ {
@ -656,90 +648,115 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
uint8_t *p_line1 = g_frame_buffer[1]; uint8_t *p_line1 = g_frame_buffer[1];
char str[22]; char str[22];
// TODO: single VFO mode
#ifdef ENABLE_ALARM #ifdef ENABLE_ALARM
if (g_current_function == FUNCTION_TRANSMIT && g_alarm_state == ALARM_STATE_ALARM) if (g_current_function == FUNCTION_TRANSMIT && g_alarm_state == ALARM_STATE_ALARM)
state = VFO_STATE_ALARM; state = VFO_STATE_ALARM;
#endif #endif
{ // ********************
{ // top line
unsigned int y = 0; unsigned int y = 0;
unsigned int x = 2; unsigned int x = 0;
sprintf(str, "VFO-%d", 1 + vfo_num); #ifdef ENABLE_KILL_REVIVE
UI_PrintStringSmall(str, x, 0, y); if (g_eeprom.config.setting.radio_disabled)
x += 7 * 6;
if (g_current_function == FUNCTION_TRANSMIT || state != VFO_STATE_NORMAL)
{ // transmitting
if (state != VFO_STATE_NORMAL)
{ {
if (state < ARRAY_SIZE(state_list))
{
#ifdef ENABLE_SMALL_BOLD
UI_PrintStringSmallBold(state_list[state], x, 0, y);
#else
UI_PrintStringSmall(state_list[state], x, 0, y);
#endif
}
}
else
{ // show the TX symbol
#ifdef ENABLE_SMALL_BOLD #ifdef ENABLE_SMALL_BOLD
UI_PrintStringSmallBold("TX", x, 0, y); UI_PrintStringSmallBold("DISABLED", x + 10, 0, y);
#else #else
UI_PrintStringSmall("TX", x, 0, y); UI_PrintStringSmall("DISABLED", x + 10, 0, y);
#endif #endif
} }
}
else
if (g_current_function == FUNCTION_RECEIVE && g_squelch_open)
{ // receiving .. show the RX symbol
#ifdef ENABLE_SMALL_BOLD
UI_PrintStringSmallBold("RX", x, 0, y);
#else
UI_PrintStringSmall("RX", x, 0, y);
#endif
}
if (state == VFO_STATE_NORMAL)
{
x += 7 * 5;
//x = LCD_WIDTH - 1 - (7 * 4);
if (scrn_chan <= USER_CHANNEL_LAST)
{ // channel mode
const bool inputting = (g_input_box_index == 0 || g_eeprom.config.setting.tx_vfo_num != vfo_num) ? false : true;
if (!inputting)
NUMBER_ToDigits(1 + scrn_chan, str); // show the memory channel number
else
memcpy(str + 5, g_input_box, 3); // show the input text
UI_PrintStringSmall("M", x, 0, y);
UI_Displaysmall_digits(3, str + 5, x + 7, y, inputting);
}
else else
if (IS_FREQ_CHANNEL(scrn_chan)) #endif
{ // frequency mode {
// show the frequency band number { // VFO number
sprintf(str, "F%u", 1 + scrn_chan - FREQ_CHANNEL_FIRST); sprintf(str, "VFO%d", 1 + vfo_num);
UI_PrintStringSmall(str, x, 0, y); UI_PrintStringSmall(str, x, 0, y);
} }
#ifdef ENABLE_NOAA
x += 7 * 5;
if (state == VFO_STATE_NORMAL)
{ // frequency band/channel number
if (scrn_chan <= USER_CHANNEL_LAST)
{ // channel mode
const bool inputting = (g_input_box_index == 0 || g_eeprom.config.setting.tx_vfo_num != vfo_num) ? false : true;
if (!inputting)
NUMBER_ToDigits(1 + scrn_chan, str); // show the memory channel number
else
memcpy(str + 5, g_input_box, 3); // show the input text
UI_PrintStringSmall("M", x, 0, y);
UI_Displaysmall_digits(3, str + 5, x + 7, y, inputting);
}
else else
{ if (IS_FREQ_CHANNEL(scrn_chan))
if (g_input_box_index == 0 || g_eeprom.config.setting.tx_vfo_num != vfo_num) { // frequency mode
{ // channel number sprintf(str, "F%u", 1 + scrn_chan - FREQ_CHANNEL_FIRST);
sprintf(str, "N%u", 1 + scrn_chan - NOAA_CHANNEL_FIRST); UI_PrintStringSmall(str, x, 0, y);
}
#ifdef ENABLE_NOAA
else
{
if (g_input_box_index == 0 || g_eeprom.config.setting.tx_vfo_num != vfo_num)
{ // channel number
sprintf(str, "N%u", 1 + scrn_chan - NOAA_CHANNEL_FIRST);
}
else
{ // user entering channel number
sprintf(str, "N%u%u", '0' + g_input_box[0], '0' + g_input_box[1]);
}
UI_PrintStringSmall(str, x, 0, y);
}
#endif
x += 7 * 5;
{ // RX or TX or state message
str[0] = 0;
if (g_current_function == FUNCTION_TRANSMIT)
strcpy(str, "TX");
else
if (g_current_function == FUNCTION_RECEIVE && g_squelch_open)
strcpy(str, "RX");
#ifdef ENABLE_SMALL_BOLD
UI_PrintStringSmallBold(str, x, 0, y);
#else
UI_PrintStringSmall(str, x, 0, y);
#endif
}
x += 7 * 3;
#if 1 // not quite enough room to fit this in :(
{ // step size
const uint32_t step = g_vfo_info[vfo_num].step_freq * 10;
if (step < 1000)
{ // Hz
sprintf(str, "%u", step);
} }
else else
{ // user entering channel number { // kHz
sprintf(str, "N%u%u", '0' + g_input_box[0], '0' + g_input_box[1]); sprintf(str, "%u.%03u", step / 1000, step % 1000);
NUMBER_trim_trailing_zeros(str);
strcat(str, "k");
} }
UI_PrintStringSmall(str, x, 0, y); UI_PrintStringSmall(str, x, 0, y);
} }
#endif #endif
}
else
{
#ifdef ENABLE_SMALL_BOLD
UI_PrintStringSmallBold(state_list[state], x, 0, y);
#else
UI_PrintStringSmall(state_list[state], x, 0, y);
#endif
}
} }
} }
@ -747,11 +764,11 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
{ {
unsigned int y = 1; unsigned int y = 1;
unsigned int x = 2; unsigned int x = 6;
if (g_input_box_index > 0 && IS_FREQ_CHANNEL(scrn_chan) && g_eeprom.config.setting.tx_vfo_num == vfo_num) if (g_input_box_index > 0 && IS_FREQ_CHANNEL(scrn_chan) && g_eeprom.config.setting.tx_vfo_num == vfo_num)
{ // user is entering a frequency { // user is entering a frequency
UI_DisplayFrequency(g_input_box, x + 5, y, true, 8); UI_DisplayFrequency(g_input_box, x, y, true, 8);
} }
else else
{ {
@ -768,16 +785,14 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
SETTINGS_fetch_channel_name(str, scrn_chan); SETTINGS_fetch_channel_name(str, scrn_chan);
if (str[0] == 0) if (str[0] == 0)
sprintf(str, "CH %u", scrn_chan); sprintf(str, "CH %u", scrn_chan);
UI_PrintString(str, x + 5, 0, y, 8); UI_PrintString(str, x, 0, y, 8);
//x = 2;
// frequency // frequency
sprintf(str, "%u.%05u", frequency / 100000, frequency % 100000); sprintf(str, "%u.%05u", frequency / 100000, frequency % 100000);
#ifdef ENABLE_TRIM_TRAILING_ZEROS #ifdef ENABLE_TRIM_TRAILING_ZEROS
NUMBER_trim_trailing_zeros(str); NUMBER_trim_trailing_zeros(str);
#endif #endif
UI_PrintString(str, x + 5, 0, y + 2, 8); UI_PrintString(str, x, 0, y + 2, 8);
} }
else else
// if (IS_FREQ_CHANNEL(scrn_chan)) // if (IS_FREQ_CHANNEL(scrn_chan))
@ -818,13 +833,13 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
else else
#endif #endif
*/ { // show the frequency in the main font */ { // show the frequency in the main font
// UI_PrintString(str, x + 5, 0, y, 8); // UI_PrintString(str, x, 0, y, 8);
UI_PrintString(str, x + 5, 0, y + 1, 8); UI_PrintString(str, x, 0, y + 1, 8);
} }
#endif #endif
} }
// show channel symbols // channel symbols
if (scrn_chan <= USER_CHANNEL_LAST) if (scrn_chan <= USER_CHANNEL_LAST)
//if (IS_NOT_NOAA_CHANNEL(scrn_chan)) //if (IS_NOT_NOAA_CHANNEL(scrn_chan))
@ -841,11 +856,6 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
//x += sizeof(BITMAP_SCANLIST2); //x += sizeof(BITMAP_SCANLIST2);
} }
#ifdef ENABLE_BIG_FREQ
// no room for these symbols
#else
{ {
#ifdef ENABLE_SHOW_FREQS_CHAN #ifdef ENABLE_SHOW_FREQS_CHAN
strcpy(str, " "); strcpy(str, " ");
@ -887,50 +897,48 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
UI_PrintStringSmall(str, LCD_WIDTH - (7 * 3), 0, y + 1); UI_PrintStringSmall(str, LCD_WIDTH - (7 * 3), 0, y + 1);
#endif #endif
} }
#endif
} }
y += 2; y += 2;
x = LCD_WIDTH - (7 * 6); x = LCD_WIDTH - (7 * 6);
// show the audio scramble symbol { // audio scramble symbol
if (g_vfo_info[vfo_num].channel.scrambler > 0 && g_eeprom.config.setting.enable_scrambler) if (g_vfo_info[vfo_num].channel.scrambler > 0 && g_eeprom.config.setting.enable_scrambler)
UI_PrintStringSmall("SCR", x, 0, y); UI_PrintStringSmall("SCR", x, 0, y);
}
{ // show the modulation mode { // modulation mode
const char *mode_list[] = {"FM", "AM", "SB", ""}; const char *mode_list[] = {"FM", "AM", "SB", ""};
const unsigned int mode = g_vfo_info[vfo_num].channel.mod_mode; strcpy(str, mode_list[g_vfo_info[vfo_num].channel.mod_mode]);
if (mode < ARRAY_SIZE(mode_list))
strcpy(str, mode_list[mode]);
UI_PrintStringSmall(str, x + (7 * 4), 0, y); UI_PrintStringSmall(str, x + (7 * 4), 0, y);
} }
y++; y++;
x = LCD_WIDTH - (7 * 5); x = LCD_WIDTH - (7 * 5);
// show the CTCSS / CDCSS code { // CTCSS/CDCSS code
str[0] = '\0'; str[0] = 0;
if (g_vfo_info[vfo_num].channel.mod_mode == MOD_MODE_FM) if (g_vfo_info[vfo_num].channel.mod_mode == MOD_MODE_FM)
{ // show the CTCSS/CDCSS symbol { // show the CTCSS/CDCSS symbol
const freq_config_t *pConfig = (g_current_function == FUNCTION_TRANSMIT) ? g_vfo_info[vfo_num].p_tx : g_vfo_info[vfo_num].p_rx; const freq_config_t *pConfig = (g_current_function == FUNCTION_TRANSMIT) ? g_vfo_info[vfo_num].p_tx : g_vfo_info[vfo_num].p_rx;
const unsigned int code_type = pConfig->code_type; const unsigned int code_type = pConfig->code_type;
unsigned int code = pConfig->code; unsigned int code = pConfig->code;
switch (code_type) switch (code_type)
{ {
case CODE_TYPE_NONE: case CODE_TYPE_NONE:
str[0] = 0; //str[0] = 0;
break; break;
case CODE_TYPE_CONTINUOUS_TONE: case CODE_TYPE_CONTINUOUS_TONE:
sprintf(str, "%3u.%u", CTCSS_TONE_LIST[code] / 10, CTCSS_TONE_LIST[code] % 10); sprintf(str, "%3u.%u", CTCSS_TONE_LIST[code] / 10, CTCSS_TONE_LIST[code] % 10);
break; break;
case CODE_TYPE_DIGITAL: case CODE_TYPE_DIGITAL:
case CODE_TYPE_REVERSE_DIGITAL: case CODE_TYPE_REVERSE_DIGITAL:
sprintf(str, "D%03o%c", DCS_CODE_LIST[code], (code_type == CODE_TYPE_DIGITAL) ? 'N' : 'I'); sprintf(str, "D%03o%c", DCS_CODE_LIST[code], (code_type == CODE_TYPE_DIGITAL) ? 'N' : 'I');
break; break;
}
} }
UI_PrintStringSmall(str, x, 0, y);
} }
UI_PrintStringSmall(str, x, 0, y);
// *************************************** // ***************************************
@ -944,17 +952,16 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
#endif #endif
{ {
if (FREQUENCY_tx_freq_check(g_vfo_info[vfo_num].p_tx->frequency) == 0) if (FREQUENCY_tx_freq_check(g_vfo_info[vfo_num].p_tx->frequency) == 0)
{ // show the TX power { // TX power
const char *pwr_list[] = {"LOW", "MID", "HIGH", ""}; const char *pwr_list[] = {"LOW", "MID", "HIGH", "U"};
const unsigned int i = g_vfo_info[vfo_num].channel.tx_power; const unsigned int i = g_vfo_info[vfo_num].channel.tx_power;
if (i < OUTPUT_POWER_USER) strcpy(str, pwr_list[i]);
strcpy(str, pwr_list[i]); if (i == OUTPUT_POWER_USER)
else sprintf(str + strlen(str), "%03u", g_tx_vfo->channel.tx_power_user);
sprintf(str, "U%02u", g_tx_vfo->channel.tx_power_user);
UI_PrintStringSmall(str, x, 0, y); UI_PrintStringSmall(str, x, 0, y);
if (g_vfo_info[vfo_num].freq_config_rx.frequency != g_vfo_info[vfo_num].freq_config_tx.frequency) if (g_vfo_info[vfo_num].freq_config_rx.frequency != g_vfo_info[vfo_num].freq_config_tx.frequency)
{ // show the TX offset symbol { // TX offset symbol
const char *dir_list[] = {"", "+", "-"}; const char *dir_list[] = {"", "+", "-"};
const unsigned int i = g_vfo_info[vfo_num].channel.tx_offset_dir; const unsigned int i = g_vfo_info[vfo_num].channel.tx_offset_dir;
UI_PrintStringSmall(dir_list[i], x + (7 * 5), 0, y); UI_PrintStringSmall(dir_list[i], x + (7 * 5), 0, y);
@ -962,33 +969,30 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
} }
} }
x += 7 * 7; { // TX/RX reverse symbol
x += 7 * 7;
if (g_vfo_info[vfo_num].channel.frequency_reverse)
UI_PrintStringSmall("R", x, 0, y);
}
// show the TX/RX reverse symbol { // wide/narrow band symbol
if (g_vfo_info[vfo_num].channel.frequency_reverse) x += 7 * 2;
UI_PrintStringSmall("R", x, 0, y); strcpy(str, " ");
if (g_vfo_info[vfo_num].channel.channel_bandwidth == BANDWIDTH_WIDE)
str[0] = 'W';
else
if (g_vfo_info[vfo_num].channel.channel_bandwidth == BANDWIDTH_NARROW)
str[0] = 'N';
UI_PrintStringSmall(str, x, 0, y);
}
x += 7 * 2; { // DTMF decoding symbol
str[0] = 0;
// show the narrow band symbol
strcpy(str, " ");
if (g_vfo_info[vfo_num].channel.channel_bandwidth == BANDWIDTH_WIDE)
str[0] = 'W';
else
if (g_vfo_info[vfo_num].channel.channel_bandwidth == BANDWIDTH_NARROW)
str[0] = 'N';
UI_PrintStringSmall(str, x, 0, y);
x += 7 * 2;
// show the DTMF decoding symbol
#ifdef ENABLE_KILL_REVIVE
if (g_vfo_info[vfo_num].channel.dtmf_decoding_enable || g_eeprom.config.setting.radio_disabled)
UI_PrintStringSmall("DTMF", x, 0, y);
#else
if (g_vfo_info[vfo_num].channel.dtmf_decoding_enable) if (g_vfo_info[vfo_num].channel.dtmf_decoding_enable)
UI_PrintStringSmall("DTMF", x, 0, y); strcpy(str, "DTMF");
#endif x += 7 * 2;
UI_PrintStringSmall(str, x, 0, y);
}
} }
UI_DisplayCenterLine(); UI_DisplayCenterLine();

View File

@ -101,9 +101,7 @@ const t_menu_item g_menu_list[] =
#ifdef ENABLE_TX_AUDIO_BAR #ifdef ENABLE_TX_AUDIO_BAR
{"Tx BAR", VOICE_ID_INVALID, MENU_TX_BAR }, {"Tx BAR", VOICE_ID_INVALID, MENU_TX_BAR },
#endif #endif
#ifdef ENABLE_RX_SIGNAL_BAR
{"Rx BAR", VOICE_ID_INVALID, MENU_RX_BAR }, {"Rx BAR", VOICE_ID_INVALID, MENU_RX_BAR },
#endif
{"1 CALL", VOICE_ID_INVALID, MENU_1_CALL }, {"1 CALL", VOICE_ID_INVALID, MENU_1_CALL },
{"SLIST", VOICE_ID_INVALID, MENU_S_LIST }, {"SLIST", VOICE_ID_INVALID, MENU_S_LIST },
{"SLIST1", VOICE_ID_INVALID, MENU_SLIST1 }, {"SLIST1", VOICE_ID_INVALID, MENU_SLIST1 },
@ -805,11 +803,9 @@ void UI_DisplayMenu(void)
break; break;
#endif #endif
#ifdef ENABLE_RX_SIGNAL_BAR case MENU_RX_BAR:
case MENU_RX_BAR: strcpy(str, g_sub_menu_off_on[g_sub_menu_selection]);
strcpy(str, g_sub_menu_off_on[g_sub_menu_selection]); break;
break;
#endif
#ifdef ENABLE_AM_FIX #ifdef ENABLE_AM_FIX
// case MENU_AM_FIX: // case MENU_AM_FIX:

View File

@ -91,9 +91,7 @@ enum
#ifdef ENABLE_TX_AUDIO_BAR #ifdef ENABLE_TX_AUDIO_BAR
MENU_TX_BAR, MENU_TX_BAR,
#endif #endif
#ifdef ENABLE_RX_SIGNAL_BAR
MENU_RX_BAR, MENU_RX_BAR,
#endif
MENU_S_LIST, MENU_S_LIST,
MENU_SLIST1, MENU_SLIST1,
MENU_SLIST2, MENU_SLIST2,