diff --git a/Makefile b/Makefile index 2fc36db..7844376 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,7 @@ ENABLE_TX1750 := 0 ENABLE_MDC1200 := 0 ENABLE_MDC1200_SHOW_OP_ARG := 1 ENABLE_MDC1200_SIDE_BEEP := 1 +# ENABLE_PWRON_PASSWORD := 0 ENABLE_RESET_AES_KEY := 0 ENABLE_BIG_FREQ := 0 @@ -49,9 +50,9 @@ ENABLE_SMALLEST_FONT := 0 ENABLE_TRIM_TRAILING_ZEROS := 0 ENABLE_WIDE_RX := 1 ENABLE_TX_WHEN_AM := 0 -# Freq calibration 188 B +# Frequency calibration 188 B ENABLE_F_CAL_MENU := 0 -ENABLE_FM_DEV_CAL_MENU := 1 +ENABLE_FM_DEV_CAL_MENU := 0 ENABLE_TX_UNLOCK_MENU := 0 #ENABLE_TX_POWER_CAL_MENU := 0 ENABLE_TX_POWER_FIX := 1 @@ -76,8 +77,6 @@ ENABLE_SQUELCH_MORE_SENSITIVE := 1 ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1 ENABLE_FASTER_CHANNEL_SCAN := 1 ENABLE_COPY_CHAN_TO_VFO_TO_CHAN := 1 -# Rx Signal Bar 400 B -ENABLE_RX_SIGNAL_BAR := 1 # Tx Audio Bar 300 B ENABLE_TX_AUDIO_BAR := 0 # Side Button Menu 300 B @@ -462,9 +461,6 @@ endif ifeq ($(ENABLE_backlight_ON_RX),1) CFLAGS += -DENABLE_backlight_ON_RX endif -ifeq ($(ENABLE_RX_SIGNAL_BAR),1) - CFLAGS += -DENABLE_RX_SIGNAL_BAR -endif ifeq ($(ENABLE_TX_AUDIO_BAR),1) CFLAGS += -DENABLE_TX_AUDIO_BAR endif diff --git a/README.md b/README.md index dd8cb4f..529532e 100644 --- a/README.md +++ b/README.md @@ -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_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_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_SIDE_BUTT_MENU := 1 enable menu option for configuring the programmable side buttons ENABLE_KEYLOCK := 1 enable keylock menu option + keylock code diff --git a/app/app.c b/app/app.c index cf7de11..debccd1 100644 --- a/app/app.c +++ b/app/app.c @@ -2085,18 +2085,15 @@ void APP_time_slice_500ms(void) #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_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 + + 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; } } } diff --git a/app/menu.c b/app/menu.c index f6e39e2..694e625 100644 --- a/app/menu.c +++ b/app/menu.c @@ -239,9 +239,7 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax) #ifdef ENABLE_TX_AUDIO_BAR case MENU_TX_BAR: #endif - #ifdef ENABLE_RX_SIGNAL_BAR - case MENU_RX_BAR: - #endif + case MENU_RX_BAR: case MENU_BUSY_CHAN_LOCK: case MENU_BEEP: #ifdef ENABLE_KEYLOCK @@ -706,11 +704,9 @@ void MENU_AcceptSetting(void) break; #endif - #ifdef ENABLE_RX_SIGNAL_BAR - case MENU_RX_BAR: - g_eeprom.config.setting.enable_rssi_bar = g_sub_menu_selection; - break; - #endif + case MENU_RX_BAR: + g_eeprom.config.setting.enable_rssi_bar = g_sub_menu_selection; + break; case MENU_COMPAND: g_tx_vfo->channel.compand = g_sub_menu_selection; @@ -1223,11 +1219,9 @@ void MENU_ShowCurrentSetting(void) break; #endif - #ifdef ENABLE_RX_SIGNAL_BAR - case MENU_RX_BAR: - g_sub_menu_selection = g_eeprom.config.setting.enable_rssi_bar; - break; - #endif + case MENU_RX_BAR: + g_sub_menu_selection = g_eeprom.config.setting.enable_rssi_bar; + break; case MENU_COMPAND: g_sub_menu_selection = g_tx_vfo->channel.compand; diff --git a/firmware.bin b/firmware.bin index 2917b48..a17a9fd 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 1f7eb79..ec26366 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/settings.c b/settings.c index 27cba20..d0b5157 100644 --- a/settings.c +++ b/settings.c @@ -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_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; - #ifdef ENABLE_RX_SIGNAL_BAR -// 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.enable_rssi_bar = (Data[6] & (1u << 1)) ? 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.battery_text = (g_eeprom.config.setting.battery_text < 3) ? g_eeprom.config.setting.battery_text : 2; diff --git a/ui/main.c b/ui/main.c index 501c817..b67ec7c 100644 --- a/ui/main.c +++ b/ui/main.c @@ -168,125 +168,119 @@ void draw_bar(uint8_t *line, const int len, const int max_width) } #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; - char str[22]; + const unsigned int line = 3; + char str[22]; - #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) + #ifdef ENABLE_KEYLOCK + if (g_eeprom.config.setting.key_lock && g_keypad_locked > 0) return false; // display is in use + #endif - if (now) - memset(g_frame_buffer[line], 0, LCD_WIDTH); + 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 - sprintf(str, "r %3d g %3u n %3u", rssi, glitch, noise); - 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 + if (now) 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); + sprintf(str, "r %3d g %3u n %3u", rssi, glitch, noise); + UI_PrintStringSmall(str, 2, 0, line); - draw_bar(g_frame_buffer[line] + bar_x, len, bar_width); + if (now) + ST7565_BlitFullScreen(); - if (now) - ST7565_BlitFullScreen(); + return true; - 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 - } - 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) { - #ifdef ENABLE_RX_SIGNAL_BAR + (void)glitch; + (void)noise; - if (g_center_line == CENTER_LINE_RSSI) - { // large RSSI dBm, S-point, bar level + if (g_center_line == CENTER_LINE_RSSI) + { // 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) - UI_DisplayRSSIBar(rssi_level, glitch, noise, true); - } - - #else - (void)glitch; - (void)noise; - #endif + //if (g_current_function == FUNCTION_RECEIVE && g_squelch_open) + if (g_current_function == FUNCTION_RECEIVE) + UI_DisplayRSSIBar(rssi_level, glitch, noise, true); + } #ifdef ENABLE_SINGLE_VFO_CHAN if (single_vfo >= 0 && !pan_enabled) @@ -580,16 +574,14 @@ void UI_DisplayCenterLine(void) else #endif - #ifdef ENABLE_RX_SIGNAL_BAR - // show the RX RSSI dBm, S-point and signal strength bar graph - 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; - 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); - } - else - #endif + // show the RX RSSI dBm, S-point and signal strength bar graph + 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; + 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); + } + else 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]; char str[22]; - // TODO: single VFO mode - #ifdef ENABLE_ALARM if (g_current_function == FUNCTION_TRANSMIT && g_alarm_state == ALARM_STATE_ALARM) state = VFO_STATE_ALARM; #endif - { + // ******************** + + { // top line + unsigned int y = 0; - unsigned int x = 2; + unsigned int x = 0; - sprintf(str, "VFO-%d", 1 + vfo_num); - UI_PrintStringSmall(str, x, 0, y); - - x += 7 * 6; - - if (g_current_function == FUNCTION_TRANSMIT || state != VFO_STATE_NORMAL) - { // transmitting - if (state != VFO_STATE_NORMAL) + #ifdef ENABLE_KILL_REVIVE + if (g_eeprom.config.setting.radio_disabled) { - 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 - UI_PrintStringSmallBold("TX", x, 0, y); + UI_PrintStringSmallBold("DISABLED", x + 10, 0, y); #else - UI_PrintStringSmall("TX", x, 0, y); + UI_PrintStringSmall("DISABLED", x + 10, 0, y); #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 - if (IS_FREQ_CHANNEL(scrn_chan)) - { // frequency mode - // show the frequency band number - sprintf(str, "F%u", 1 + scrn_chan - FREQ_CHANNEL_FIRST); + #endif + { + { // VFO number + sprintf(str, "VFO%d", 1 + vfo_num); 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 - { - 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); + if (IS_FREQ_CHANNEL(scrn_chan)) + { // frequency mode + sprintf(str, "F%u", 1 + scrn_chan - FREQ_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 - { // user entering channel number - sprintf(str, "N%u%u", '0' + g_input_box[0], '0' + g_input_box[1]); + { // kHz + sprintf(str, "%u.%03u", step / 1000, step % 1000); + NUMBER_trim_trailing_zeros(str); + strcat(str, "k"); } 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 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) { // 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 { @@ -768,16 +785,14 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA SETTINGS_fetch_channel_name(str, scrn_chan); if (str[0] == 0) sprintf(str, "CH %u", scrn_chan); - UI_PrintString(str, x + 5, 0, y, 8); - - //x = 2; + UI_PrintString(str, x, 0, y, 8); // frequency sprintf(str, "%u.%05u", frequency / 100000, frequency % 100000); #ifdef ENABLE_TRIM_TRAILING_ZEROS NUMBER_trim_trailing_zeros(str); #endif - UI_PrintString(str, x + 5, 0, y + 2, 8); + UI_PrintString(str, x, 0, y + 2, 8); } else // if (IS_FREQ_CHANNEL(scrn_chan)) @@ -818,13 +833,13 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA else #endif */ { // show the frequency in the main font -// UI_PrintString(str, x + 5, 0, y, 8); - UI_PrintString(str, x + 5, 0, y + 1, 8); +// UI_PrintString(str, x, 0, y, 8); + UI_PrintString(str, x, 0, y + 1, 8); } #endif } - // show channel symbols + // channel symbols if (scrn_chan <= USER_CHANNEL_LAST) //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); } - #ifdef ENABLE_BIG_FREQ - - // no room for these symbols - - #else { #ifdef ENABLE_SHOW_FREQS_CHAN 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); #endif } - #endif - } y += 2; x = LCD_WIDTH - (7 * 6); - // show the audio scramble symbol - if (g_vfo_info[vfo_num].channel.scrambler > 0 && g_eeprom.config.setting.enable_scrambler) - UI_PrintStringSmall("SCR", x, 0, y); + { // audio scramble symbol + if (g_vfo_info[vfo_num].channel.scrambler > 0 && g_eeprom.config.setting.enable_scrambler) + UI_PrintStringSmall("SCR", x, 0, y); + } - { // show the modulation mode + { // modulation mode const char *mode_list[] = {"FM", "AM", "SB", ""}; - const unsigned int mode = g_vfo_info[vfo_num].channel.mod_mode; - if (mode < ARRAY_SIZE(mode_list)) - strcpy(str, mode_list[mode]); + strcpy(str, mode_list[g_vfo_info[vfo_num].channel.mod_mode]); UI_PrintStringSmall(str, x + (7 * 4), 0, y); } y++; x = LCD_WIDTH - (7 * 5); - // show the CTCSS / CDCSS code - str[0] = '\0'; - if (g_vfo_info[vfo_num].channel.mod_mode == MOD_MODE_FM) - { // 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 unsigned int code_type = pConfig->code_type; - unsigned int code = pConfig->code; - switch (code_type) - { - case CODE_TYPE_NONE: - str[0] = 0; - break; - case CODE_TYPE_CONTINUOUS_TONE: - sprintf(str, "%3u.%u", CTCSS_TONE_LIST[code] / 10, CTCSS_TONE_LIST[code] % 10); - break; - case CODE_TYPE_DIGITAL: - case CODE_TYPE_REVERSE_DIGITAL: - sprintf(str, "D%03o%c", DCS_CODE_LIST[code], (code_type == CODE_TYPE_DIGITAL) ? 'N' : 'I'); - break; + { // CTCSS/CDCSS code + str[0] = 0; + if (g_vfo_info[vfo_num].channel.mod_mode == MOD_MODE_FM) + { // 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 unsigned int code_type = pConfig->code_type; + unsigned int code = pConfig->code; + switch (code_type) + { + case CODE_TYPE_NONE: + //str[0] = 0; + break; + case CODE_TYPE_CONTINUOUS_TONE: + sprintf(str, "%3u.%u", CTCSS_TONE_LIST[code] / 10, CTCSS_TONE_LIST[code] % 10); + break; + case CODE_TYPE_DIGITAL: + case CODE_TYPE_REVERSE_DIGITAL: + sprintf(str, "D%03o%c", DCS_CODE_LIST[code], (code_type == CODE_TYPE_DIGITAL) ? 'N' : 'I'); + 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 { if (FREQUENCY_tx_freq_check(g_vfo_info[vfo_num].p_tx->frequency) == 0) - { // show the TX power - const char *pwr_list[] = {"LOW", "MID", "HIGH", ""}; + { // TX power + const char *pwr_list[] = {"LOW", "MID", "HIGH", "U"}; const unsigned int i = g_vfo_info[vfo_num].channel.tx_power; - if (i < OUTPUT_POWER_USER) - strcpy(str, pwr_list[i]); - else - sprintf(str, "U%02u", g_tx_vfo->channel.tx_power_user); + strcpy(str, pwr_list[i]); + if (i == OUTPUT_POWER_USER) + sprintf(str + strlen(str), "%03u", g_tx_vfo->channel.tx_power_user); 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) - { // show the TX offset symbol + { // TX offset symbol const char *dir_list[] = {"", "+", "-"}; const unsigned int i = g_vfo_info[vfo_num].channel.tx_offset_dir; 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 - if (g_vfo_info[vfo_num].channel.frequency_reverse) - UI_PrintStringSmall("R", x, 0, y); + { // wide/narrow band symbol + x += 7 * 2; + 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 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 + { // DTMF decoding symbol + str[0] = 0; if (g_vfo_info[vfo_num].channel.dtmf_decoding_enable) - UI_PrintStringSmall("DTMF", x, 0, y); - #endif + strcpy(str, "DTMF"); + x += 7 * 2; + UI_PrintStringSmall(str, x, 0, y); + } } UI_DisplayCenterLine(); diff --git a/ui/menu.c b/ui/menu.c index 060cc01..c1fc5c5 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -101,9 +101,7 @@ const t_menu_item g_menu_list[] = #ifdef ENABLE_TX_AUDIO_BAR {"Tx BAR", VOICE_ID_INVALID, MENU_TX_BAR }, #endif -#ifdef ENABLE_RX_SIGNAL_BAR {"Rx BAR", VOICE_ID_INVALID, MENU_RX_BAR }, -#endif {"1 CALL", VOICE_ID_INVALID, MENU_1_CALL }, {"SLIST", VOICE_ID_INVALID, MENU_S_LIST }, {"SLIST1", VOICE_ID_INVALID, MENU_SLIST1 }, @@ -805,11 +803,9 @@ void UI_DisplayMenu(void) break; #endif - #ifdef ENABLE_RX_SIGNAL_BAR - case MENU_RX_BAR: - strcpy(str, g_sub_menu_off_on[g_sub_menu_selection]); - break; - #endif + case MENU_RX_BAR: + strcpy(str, g_sub_menu_off_on[g_sub_menu_selection]); + break; #ifdef ENABLE_AM_FIX // case MENU_AM_FIX: diff --git a/ui/menu.h b/ui/menu.h index 09457c3..97a4010 100644 --- a/ui/menu.h +++ b/ui/menu.h @@ -91,9 +91,7 @@ enum #ifdef ENABLE_TX_AUDIO_BAR MENU_TX_BAR, #endif -#ifdef ENABLE_RX_SIGNAL_BAR MENU_RX_BAR, -#endif MENU_S_LIST, MENU_SLIST1, MENU_SLIST2,