0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-08-03 17:46:31 +03:00

deleted the TX timeout bar

This commit is contained in:
OneOfEleven
2023-11-02 15:22:32 +00:00
parent 5055586035
commit 88f0ee2500
11 changed files with 30 additions and 116 deletions

View File

@@ -74,8 +74,6 @@ 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 # Rx Signal Bar 400 B
ENABLE_RX_SIGNAL_BAR := 1 ENABLE_RX_SIGNAL_BAR := 1
# Tx Timeout Bar 200 B
ENABLE_TX_TIMEOUT_BAR := 0
# 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
@@ -118,11 +116,6 @@ else
ENABLE_FMRADIO := 0 ENABLE_FMRADIO := 0
endif 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) ifeq ($(ENABLE_VOICE),1)
# no need for beeps # no need for beeps
ENABLE_BOOT_BEEPS := 0 ENABLE_BOOT_BEEPS := 0
@@ -445,9 +438,6 @@ 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
ifeq ($(ENABLE_TX_TIMEOUT_BAR),1)
CFLAGS += -DENABLE_TX_TIMEOUT_BAR
endif
ifeq ($(ENABLE_COPY_CHAN_TO_VFO_TO_CHAN),1) ifeq ($(ENABLE_COPY_CHAN_TO_VFO_TO_CHAN),1)
CFLAGS += -DENABLE_COPY_CHAN_TO_VFO_TO_CHAN CFLAGS += -DENABLE_COPY_CHAN_TO_VFO_TO_CHAN
endif endif

View File

@@ -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_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_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_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

@@ -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) if (g_scan_state_dir != SCAN_STATE_DIR_OFF || g_css_scan_mode != CSS_SCAN_MODE_OFF)
return; return;
if (g_vox_noise_detected) if (g_vox_audio_detected)
{ {
if (g_vox_lost) if (g_vox_lost)
{
g_vox_stop_tick_10ms = vox_stop_10ms; // 1 second g_vox_stop_tick_10ms = vox_stop_10ms; // 1 second
}
else else
if (g_vox_stop_tick_10ms == 0) if (g_vox_stop_tick_10ms == 0)
{ g_vox_audio_detected = false;
g_vox_noise_detected = false;
g_update_status = true;
}
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) if (g_flag_end_tx)
{ // back to RX mode { // 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_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_flag_end_tx = false;
} }
g_update_status = true;
return; return;
} }
if (!g_vox_lost) if (!g_vox_lost)
return; return;
g_vox_noise_detected = true; g_vox_audio_detected = true;
g_update_status = true; g_update_status = true;
@@ -1197,7 +1192,7 @@ void APP_end_tx(void)
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
if (g_fm_radio_mode) if (g_fm_radio_mode)
return; return; // can't do VOX while the speaker is emitting noise
#endif #endif
if (g_current_display_screen == DISPLAY_MENU) 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) if (g_current_function == FUNCTION_TRANSMIT || g_serial_config_tick_500ms > 0)
return; return;
// ************* go into TX mode // ************* go into TX mode
g_dtmf_reply_state = DTMF_REPLY_NONE; 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) if (g_rx_vfo_is_active && g_current_display_screen == DISPLAY_MAIN)
GUI_SelectNextDisplay(DISPLAY_MAIN); GUI_SelectNextDisplay(DISPLAY_MAIN);
g_rx_vfo_is_active = false; g_rx_vfo_is_active = false;
g_rx_reception_mode = RX_MODE_NONE; 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))
if (g_current_function == FUNCTION_TRANSMIT && g_tx_timer_tick_500ms & 1u)) g_update_display = true;
g_update_display = true;
// UI_DisplayTXCountdown(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)
@@ -2071,44 +2063,44 @@ void APP_time_slice_500ms(void)
} }
} }
#endif #endif
if (exit_menu) if (exit_menu)
{ {
g_menu_tick_10ms = 0; g_menu_tick_10ms = 0;
if (g_eeprom.config.setting.backlight_time == 0) if (g_eeprom.config.setting.backlight_time == 0)
{ {
g_backlight_tick_500ms = 0; g_backlight_tick_500ms = 0;
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight OFF GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight OFF
} }
if (g_input_box_index > 0 || g_dtmf_input_mode) if (g_input_box_index > 0 || g_dtmf_input_mode)
AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL); AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL);
/* /*
if (g_current_display_screen == DISPLAY_SEARCH) if (g_current_display_screen == DISPLAY_SEARCH)
{ {
BK4819_StopScan(); BK4819_StopScan();
RADIO_configure_channel(0, VFO_CONFIGURE_RELOAD); RADIO_configure_channel(0, VFO_CONFIGURE_RELOAD);
RADIO_configure_channel(1, VFO_CONFIGURE_RELOAD); RADIO_configure_channel(1, VFO_CONFIGURE_RELOAD);
RADIO_setup_registers(true); RADIO_setup_registers(true);
} }
*/ */
DTMF_clear_input_box(); DTMF_clear_input_box();
g_fkey_pressed = false; g_fkey_pressed = false;
g_input_box_index = 0; g_input_box_index = 0;
g_ask_to_save = false; g_ask_to_save = false;
g_ask_to_delete = false; g_ask_to_delete = false;
g_update_status = true; g_update_status = true;
g_update_display = true; g_update_display = true;
{ {
gui_display_type_t disp = DISPLAY_INVALID; gui_display_type_t disp = DISPLAY_INVALID;
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
if (g_fm_radio_mode && if (g_fm_radio_mode &&
g_current_function != FUNCTION_RECEIVE && g_current_function != FUNCTION_RECEIVE &&
@@ -2118,7 +2110,7 @@ void APP_time_slice_500ms(void)
disp = DISPLAY_FM; disp = DISPLAY_FM;
} }
#endif #endif
if (disp == DISPLAY_INVALID) if (disp == DISPLAY_INVALID)
{ {
#ifndef ENABLE_CODE_SEARCH_TIMEOUT #ifndef ENABLE_CODE_SEARCH_TIMEOUT
@@ -2126,12 +2118,12 @@ void APP_time_slice_500ms(void)
#endif #endif
disp = DISPLAY_MAIN; disp = DISPLAY_MAIN;
} }
if (disp != DISPLAY_INVALID) if (disp != DISPLAY_INVALID)
GUI_SelectNextDisplay(disp); GUI_SelectNextDisplay(disp);
} }
} }
} }
} }
if (g_current_function != FUNCTION_POWER_SAVE && g_current_function != FUNCTION_TRANSMIT) if (g_current_function != FUNCTION_POWER_SAVE && g_current_function != FUNCTION_TRANSMIT)

View File

@@ -122,7 +122,7 @@ void GENERIC_Key_PTT(bool key_pressed)
g_flag_end_tx = false; g_flag_end_tx = false;
#ifdef ENABLE_VOX #ifdef ENABLE_VOX
g_vox_noise_detected = false; g_vox_audio_detected = false;
#endif #endif
RADIO_set_vfo_state(VFO_STATE_NORMAL); RADIO_set_vfo_state(VFO_STATE_NORMAL);

Binary file not shown.

Binary file not shown.

2
misc.c
View File

@@ -176,7 +176,7 @@ uint8_t g_ctcss_tail_phase_shift_rx;
#ifdef ENABLE_VOX #ifdef ENABLE_VOX
bool g_vox_lost; 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_resume_tick_10ms;
uint16_t g_vox_pause_tick_10ms; uint16_t g_vox_pause_tick_10ms;
#endif #endif

2
misc.h
View File

@@ -271,7 +271,7 @@ extern uint8_t g_ctcss_tail_phase_shift_rx;
#ifdef ENABLE_VOX #ifdef ENABLE_VOX
extern bool g_vox_lost; 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_resume_tick_10ms;
extern uint16_t g_vox_pause_tick_10ms; extern uint16_t g_vox_pause_tick_10ms;
#endif #endif

View File

@@ -74,60 +74,6 @@ void draw_bar(uint8_t *line, const int len, const int max_width)
#endif #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) void UI_drawBars(uint8_t *p, const unsigned int level)
{ {
#pragma GCC diagnostic push #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; 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 #ifdef ENABLE_TX_AUDIO_BAR
// show the TX audio level // show the TX audio level
if (UI_DisplayAudioBar(false)) if (UI_DisplayAudioBar(false))

View File

@@ -20,7 +20,6 @@
enum center_line_e { enum center_line_e {
CENTER_LINE_NONE = 0, CENTER_LINE_NONE = 0,
CENTER_LINE_IN_USE, CENTER_LINE_IN_USE,
CENTER_LINE_TX_TIMEOUT,
CENTER_LINE_AUDIO_BAR, CENTER_LINE_AUDIO_BAR,
CENTER_LINE_RSSI, CENTER_LINE_RSSI,
CENTER_LINE_AM_FIX_DATA, CENTER_LINE_AM_FIX_DATA,
@@ -32,9 +31,6 @@ typedef enum center_line_e center_line_t;
extern center_line_t g_center_line; extern center_line_t g_center_line;
#ifdef ENABLE_TX_TIMEOUT_BAR
bool UI_DisplayTXCountdown(const bool now);
#endif
#ifdef ENABLE_TX_AUDIO_BAR #ifdef ENABLE_TX_AUDIO_BAR
bool UI_DisplayAudioBar(const bool now); bool UI_DisplayAudioBar(const bool now);
#endif #endif

View File

@@ -159,7 +159,7 @@ void UI_DisplayStatus(const bool test_display)
// VOX indicator // VOX indicator
if (g_eeprom.config.setting.vox_enabled || test_display) 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; x += sizeof(BITMAP_VOX) + 1;
} }
#endif #endif