0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-18 22:29:50 +03:00

added TX timeout beeps

This commit is contained in:
OneOfEleven
2023-11-06 12:21:52 +00:00
parent b4841f0ba9
commit 521793ba6f
9 changed files with 128 additions and 147 deletions

View File

@ -323,7 +323,7 @@ void ACTION_Scan(bool bRestart)
{
g_input_box_index = 0;
(void)b1750; // stop unused compile warning
(void)b1750; // stop compile warning
#if defined(ENABLE_ALARM) && defined(ENABLE_TX1750)
g_alarm_state = b1750 ? ALARM_STATE_TX1750 : ALARM_STATE_TXALARM;
@ -337,7 +337,7 @@ void ACTION_Scan(bool bRestart)
g_flag_prepare_tx = true;
if (g_current_display_screen != DISPLAY_MENU) // 1of11 .. don't close the menu
if (g_current_display_screen != DISPLAY_MENU)
g_request_display_screen = DISPLAY_MAIN;
}
#endif

View File

@ -671,6 +671,8 @@ static void AIRCOPY_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
INPUTBOX_append(Key);
NUMBER_Get(g_input_box, &Frequency);
g_request_display_screen = DISPLAY_AIRCOPY;
if (g_input_box_index < 6)
@ -683,8 +685,6 @@ static void AIRCOPY_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
g_input_box_index = 0;
NUMBER_Get(g_input_box, &Frequency);
for (i = 0; i < ARRAY_SIZE(FREQ_BAND_TABLE); i++)
{
if (Frequency >= FREQ_BAND_TABLE[i].lower && Frequency < FREQ_BAND_TABLE[i].upper)

171
app/app.c
View File

@ -1994,8 +1994,19 @@ void APP_time_slice_500ms(void)
}
}
if (g_current_function == FUNCTION_TRANSMIT && (g_tx_timer_tick_500ms & 1u))
g_update_display = true;
if (g_current_function == FUNCTION_TRANSMIT)
{
if (g_tx_timer_tick_500ms < 6)
{ // <= 3 seconds left
if (g_tx_timer_tick_500ms & 1u)
BK4819_start_tone(880, 10, true, false);
else
BK4819_stop_tones(true);
}
if (g_tx_timer_tick_500ms & 1u)
g_update_display = true;
}
if (g_menu_tick_10ms > 0)
if (--g_menu_tick_10ms == 0)
@ -2289,75 +2300,6 @@ void APP_time_slice_10ms(void)
{
g_flash_light_blink_tick_10ms++;
#ifdef ENABLE_AIRCOPY
if (g_current_display_screen == DISPLAY_AIRCOPY)
{ // we're in AIRCOPY mode
if (g_aircopy_state == AIRCOPY_TX)
AIRCOPY_process_fsk_tx_10ms();
AIRCOPY_process_fsk_rx_10ms();
APP_check_keys();
if (g_update_display)
GUI_DisplayScreen();
if (g_update_status)
UI_DisplayStatus(false);
return;
}
#endif
#ifdef ENABLE_UART
if (UART_IsCommandAvailable())
{
__disable_irq();
UART_HandleCommand();
__enable_irq();
}
#endif
if (g_current_function == FUNCTION_TRANSMIT && (g_tx_timeout_reached || g_serial_config_tick_500ms > 0))
{ // transmitter timed out or must de-key
g_tx_timeout_reached = false;
g_flag_end_tx = true;
APP_end_tx();
AUDIO_PlayBeep(BEEP_880HZ_60MS_TRIPLE_BEEP);
RADIO_set_vfo_state(VFO_STATE_TIMEOUT);
GUI_DisplayScreen();
}
#ifdef ENABLE_UART
if (g_serial_config_tick_500ms > 0)
{ // config upload/download is running
if (g_update_display)
GUI_DisplayScreen();
if (g_update_status)
UI_DisplayStatus(false);
return;
}
#endif
#ifdef ENABLE_AM_FIX
if (g_rx_vfo->channel.am_mode > 0 && g_eeprom.config.setting.am_fix)
AM_fix_10ms(g_rx_vfo_num);
#endif
#ifdef ENABLE_FMRADIO
if (g_flag_save_fm)
{
SETTINGS_save_fm();
g_flag_save_fm = false;
}
#endif
if (g_flag_save_vfo)
{
SETTINGS_save_vfo_indices();
@ -2370,6 +2312,32 @@ void APP_time_slice_10ms(void)
g_flag_save_settings = false;
}
if (g_request_display_screen != DISPLAY_INVALID)
{
GUI_SelectNextDisplay(g_request_display_screen);
g_request_display_screen = DISPLAY_INVALID;
}
if (g_update_display)
GUI_DisplayScreen();
if (g_update_status)
UI_DisplayStatus(false);
#ifdef ENABLE_AIRCOPY
if (g_current_display_screen == DISPLAY_AIRCOPY)
{ // we're in AIRCOPY mode
if (g_aircopy_state == AIRCOPY_TX)
AIRCOPY_process_fsk_tx_10ms();
AIRCOPY_process_fsk_rx_10ms();
APP_check_keys();
return;
}
#endif
if (g_flag_save_channel)
{
SETTINGS_save_channel(g_tx_vfo->channel_save, g_eeprom.config.setting.tx_vfo_num, g_tx_vfo, g_flag_save_channel ? 1 : 0);
@ -2385,17 +2353,55 @@ void APP_time_slice_10ms(void)
GUI_SelectNextDisplay(DISPLAY_MAIN);
}
#ifdef ENABLE_UART
if (UART_IsCommandAvailable())
{
__disable_irq();
UART_HandleCommand();
__enable_irq();
}
#endif
if (g_current_function == FUNCTION_TRANSMIT && (g_tx_timeout_reached || g_serial_config_tick_500ms > 0))
{ // transmitter timed out or must de-key
BK4819_stop_tones(true);
g_tx_timeout_reached = false;
g_flag_end_tx = true;
APP_end_tx();
AUDIO_PlayBeep(BEEP_880HZ_60MS_TRIPLE_BEEP);
RADIO_set_vfo_state(VFO_STATE_TIMEOUT);
GUI_DisplayScreen();
}
#ifdef ENABLE_UART
if (g_serial_config_tick_500ms > 0)
return;
#endif
#ifdef ENABLE_AM_FIX
if (g_rx_vfo->channel.am_mode > 0 && g_eeprom.config.setting.am_fix)
AM_fix_10ms(g_rx_vfo_num);
#endif
#ifdef ENABLE_FMRADIO
if (g_flag_save_fm)
{
SETTINGS_save_fm();
g_flag_save_fm = false;
}
#endif
if (g_reduced_service || g_serial_config_tick_500ms > 0)
{
if (g_current_function == FUNCTION_TRANSMIT)
g_tx_timeout_reached = true;
if (g_update_display)
GUI_DisplayScreen();
if (g_update_status)
UI_DisplayStatus(false);
return;
}
@ -2427,12 +2433,6 @@ void APP_time_slice_10ms(void)
}
#endif
if (g_update_display)
GUI_DisplayScreen();
if (g_update_status)
UI_DisplayStatus(false);
APP_process_flash_light_10ms();
#ifdef ENABLE_FMRADIO
@ -2958,9 +2958,4 @@ Skip:
g_another_voice_id = VOICE_ID_INVALID;
}
#endif
GUI_SelectNextDisplay(g_request_display_screen);
g_request_display_screen = DISPLAY_INVALID;
g_update_display = true;
}