diff --git a/Makefile b/Makefile index e9bedf5..752f819 100644 --- a/Makefile +++ b/Makefile @@ -74,8 +74,6 @@ ENABLE_FASTER_CHANNEL_SCAN := 1 ENABLE_COPY_CHAN_TO_VFO_TO_CHAN := 1 # Rx Signal Bar 400 B ENABLE_RX_SIGNAL_BAR := 1 -# Tx Timeout Bar 200 B -ENABLE_TX_TIMEOUT_BAR := 0 # Tx Audio Bar 300 B ENABLE_TX_AUDIO_BAR := 0 # Side Button Menu 300 B @@ -118,11 +116,6 @@ else ENABLE_FMRADIO := 0 endif -ifeq ($(ENABLE_TX_TIMEOUT_BAR),1) - # can't have ENABLE_TX_TIMEOUT_BAR and ENABLE_TX_AUDIO_BAR enabled at same time - ENABLE_TX_AUDIO_BAR := 0 -endif - ifeq ($(ENABLE_VOICE),1) # no need for beeps ENABLE_BOOT_BEEPS := 0 @@ -445,9 +438,6 @@ endif ifeq ($(ENABLE_TX_AUDIO_BAR),1) CFLAGS += -DENABLE_TX_AUDIO_BAR endif -ifeq ($(ENABLE_TX_TIMEOUT_BAR),1) - CFLAGS += -DENABLE_TX_TIMEOUT_BAR -endif ifeq ($(ENABLE_COPY_CHAN_TO_VFO_TO_CHAN),1) CFLAGS += -DENABLE_COPY_CHAN_TO_VFO_TO_CHAN endif diff --git a/README.md b/README.md index 428b0bb..c0210ca 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,6 @@ ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1 open the squelch when holding down U 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_TIMEOUT_BAR := 0 show the remainng TX time 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 9c1dce8..ae402c8 100644 --- a/app/app.c +++ b/app/app.c @@ -1142,20 +1142,15 @@ void APP_end_tx(void) if (g_scan_state_dir != SCAN_STATE_DIR_OFF || g_css_scan_mode != CSS_SCAN_MODE_OFF) return; - if (g_vox_noise_detected) + if (g_vox_audio_detected) { if (g_vox_lost) - { g_vox_stop_tick_10ms = vox_stop_10ms; // 1 second - } else if (g_vox_stop_tick_10ms == 0) - { - g_vox_noise_detected = false; - g_update_status = true; - } + g_vox_audio_detected = false; - if (g_current_function == FUNCTION_TRANSMIT && !g_ptt_is_pressed && !g_vox_noise_detected) + if (g_current_function == FUNCTION_TRANSMIT && !g_ptt_is_pressed && !g_vox_audio_detected) { if (g_flag_end_tx) { // back to RX mode @@ -1171,19 +1166,19 @@ void APP_end_tx(void) g_rtte_count_down = g_eeprom.config.setting.repeater_tail_tone_elimination * 10; } - g_update_status = true; - g_update_display = true; + g_update_display = true; g_flag_end_tx = false; } + g_update_status = true; return; } if (!g_vox_lost) return; - g_vox_noise_detected = true; + g_vox_audio_detected = true; g_update_status = true; @@ -1197,7 +1192,7 @@ void APP_end_tx(void) #ifdef ENABLE_FMRADIO if (g_fm_radio_mode) - return; + return; // can't do VOX while the speaker is emitting noise #endif if (g_current_display_screen == DISPLAY_MENU) @@ -1208,7 +1203,7 @@ void APP_end_tx(void) if (g_current_function == FUNCTION_TRANSMIT || g_serial_config_tick_500ms > 0) return; - + // ************* go into TX mode g_dtmf_reply_state = DTMF_REPLY_NONE; @@ -1648,7 +1643,7 @@ void APP_process_scan(void) { if (g_rx_vfo_is_active && g_current_display_screen == DISPLAY_MAIN) GUI_SelectNextDisplay(DISPLAY_MAIN); - + g_rx_vfo_is_active = false; g_rx_reception_mode = RX_MODE_NONE; } @@ -1976,11 +1971,8 @@ void APP_time_slice_500ms(void) } } - #ifdef ENABLE_TX_TIMEOUT_BAR - if (g_current_function == FUNCTION_TRANSMIT && g_tx_timer_tick_500ms & 1u)) - g_update_display = true; -// UI_DisplayTXCountdown(true); - #endif + if (g_current_function == FUNCTION_TRANSMIT && (g_tx_timer_tick_500ms & 1u)) + g_update_display = true; if (g_menu_tick_10ms > 0) if (--g_menu_tick_10ms == 0) @@ -2071,44 +2063,44 @@ void APP_time_slice_500ms(void) } } #endif - + if (exit_menu) { g_menu_tick_10ms = 0; - + if (g_eeprom.config.setting.backlight_time == 0) { g_backlight_tick_500ms = 0; GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight OFF } - + if (g_input_box_index > 0 || g_dtmf_input_mode) AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL); -/* +/* if (g_current_display_screen == DISPLAY_SEARCH) { BK4819_StopScan(); - + RADIO_configure_channel(0, VFO_CONFIGURE_RELOAD); RADIO_configure_channel(1, VFO_CONFIGURE_RELOAD); - + RADIO_setup_registers(true); } -*/ +*/ DTMF_clear_input_box(); - + g_fkey_pressed = false; g_input_box_index = 0; - + g_ask_to_save = false; g_ask_to_delete = false; - + g_update_status = true; g_update_display = true; - + { gui_display_type_t disp = DISPLAY_INVALID; - + #ifdef ENABLE_FMRADIO if (g_fm_radio_mode && g_current_function != FUNCTION_RECEIVE && @@ -2118,7 +2110,7 @@ void APP_time_slice_500ms(void) disp = DISPLAY_FM; } #endif - + if (disp == DISPLAY_INVALID) { #ifndef ENABLE_CODE_SEARCH_TIMEOUT @@ -2126,12 +2118,12 @@ void APP_time_slice_500ms(void) #endif disp = DISPLAY_MAIN; } - + if (disp != DISPLAY_INVALID) GUI_SelectNextDisplay(disp); } } - } + } } if (g_current_function != FUNCTION_POWER_SAVE && g_current_function != FUNCTION_TRANSMIT) diff --git a/app/generic.c b/app/generic.c index f65f1c2..1b6b305 100644 --- a/app/generic.c +++ b/app/generic.c @@ -122,7 +122,7 @@ void GENERIC_Key_PTT(bool key_pressed) g_flag_end_tx = false; #ifdef ENABLE_VOX - g_vox_noise_detected = false; + g_vox_audio_detected = false; #endif RADIO_set_vfo_state(VFO_STATE_NORMAL); diff --git a/firmware.bin b/firmware.bin index 50b0d0c..452c815 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 665cf3e..4c38263 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/misc.c b/misc.c index 86616ee..8abbae4 100644 --- a/misc.c +++ b/misc.c @@ -176,7 +176,7 @@ uint8_t g_ctcss_tail_phase_shift_rx; #ifdef ENABLE_VOX bool g_vox_lost; - bool g_vox_noise_detected; + bool g_vox_audio_detected; uint16_t g_vox_resume_tick_10ms; uint16_t g_vox_pause_tick_10ms; #endif diff --git a/misc.h b/misc.h index b97f612..ec2ee92 100644 --- a/misc.h +++ b/misc.h @@ -271,7 +271,7 @@ extern uint8_t g_ctcss_tail_phase_shift_rx; #ifdef ENABLE_VOX extern bool g_vox_lost; - extern bool g_vox_noise_detected; + extern bool g_vox_audio_detected; extern uint16_t g_vox_resume_tick_10ms; extern uint16_t g_vox_pause_tick_10ms; #endif diff --git a/ui/main.c b/ui/main.c index aa02e84..d499042 100644 --- a/ui/main.c +++ b/ui/main.c @@ -74,60 +74,6 @@ void draw_bar(uint8_t *line, const int len, const int max_width) #endif } -#ifdef ENABLE_TX_TIMEOUT_BAR - bool UI_DisplayTXCountdown(const bool now) - { - unsigned int timeout_secs = 0; - - if (g_current_function != FUNCTION_TRANSMIT || g_current_display_screen != DISPLAY_MAIN) - return false; - - if (g_center_line != CENTER_LINE_NONE && g_center_line != CENTER_LINE_TX_TIMEOUT) - return false; - - if (g_eeprom.config.setting.tx_timeout == 0) - timeout_secs = 30; // 30 sec - else - if (g_eeprom.config.setting.tx_timeout < (ARRAY_SIZE(g_sub_menu_tx_timeout) - 1)) - timeout_secs = 60 * g_eeprom.config.setting.tx_timeout; // minutes - else - timeout_secs = 60 * 15; // 15 minutes - - if (timeout_secs == 0 || g_tx_timer_tick_500ms == 0) - return false; - - { - const unsigned int line = 3; - const unsigned int txt_width = 7 * 6; // 6 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 unsigned int secs = g_tx_timer_tick_500ms / 2; - const unsigned int level = ((secs * bar_width) + (timeout_secs / 2)) / timeout_secs; // with rounding -// const unsigned int level = (((timeout_secs - secs) * bar_width) + (timeout_secs / 2)) / timeout_secs; // with rounding - const unsigned int len = (level <= bar_width) ? level : bar_width; - uint8_t *p_line = g_frame_buffer[line]; - char s[17]; - - if (now) - memset(p_line, 0, LCD_WIDTH); - - sprintf(s, "TX %u", secs); - #ifdef ENABLE_SMALL_BOLD - UI_PrintStringSmallBold(s, 2, 0, line); - #else - UI_PrintStringSmall(s, 2, 0, line); - #endif - - draw_bar(p_line + bar_x, len, bar_width); - - if (now) - ST7565_BlitFullScreen(); - } - - return true; - } -#endif - void UI_drawBars(uint8_t *p, const unsigned int level) { #pragma GCC diagnostic push @@ -929,15 +875,6 @@ void UI_DisplayMain(void) const bool rx = (g_current_function == FUNCTION_RECEIVE && g_squelch_open) ? true : false; - #ifdef ENABLE_TX_TIMEOUT_BAR - // show the TX timeout count down - if (UI_DisplayTXCountdown(false)) - { - g_center_line = CENTER_LINE_TX_TIMEOUT; - } - else - #endif - #ifdef ENABLE_TX_AUDIO_BAR // show the TX audio level if (UI_DisplayAudioBar(false)) diff --git a/ui/main.h b/ui/main.h index 3ac9ffb..4260222 100644 --- a/ui/main.h +++ b/ui/main.h @@ -20,7 +20,6 @@ enum center_line_e { CENTER_LINE_NONE = 0, CENTER_LINE_IN_USE, - CENTER_LINE_TX_TIMEOUT, CENTER_LINE_AUDIO_BAR, CENTER_LINE_RSSI, CENTER_LINE_AM_FIX_DATA, @@ -32,9 +31,6 @@ typedef enum center_line_e center_line_t; extern center_line_t g_center_line; -#ifdef ENABLE_TX_TIMEOUT_BAR - bool UI_DisplayTXCountdown(const bool now); -#endif #ifdef ENABLE_TX_AUDIO_BAR bool UI_DisplayAudioBar(const bool now); #endif diff --git a/ui/status.c b/ui/status.c index a04c547..eda354b 100644 --- a/ui/status.c +++ b/ui/status.c @@ -159,7 +159,7 @@ void UI_DisplayStatus(const bool test_display) // VOX indicator if (g_eeprom.config.setting.vox_enabled || test_display) { - memcpy(line + x, g_vox_noise_detected ? BITMAP_VOX : BITMAP_VOX_SMALL, sizeof(BITMAP_VOX)); + memcpy(line + x, g_vox_audio_detected ? BITMAP_VOX : BITMAP_VOX_SMALL, sizeof(BITMAP_VOX)); x += sizeof(BITMAP_VOX) + 1; } #endif