mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-19 14:48:03 +03:00
Renames, some code changes
This commit is contained in:
98
functions.c
98
functions.c
@ -177,6 +177,16 @@ void FUNCTION_Select(function_type_t Function)
|
||||
UART_SendText("func transmit\r\n");
|
||||
#endif
|
||||
|
||||
if (g_setting_backlight_on_tx_rx == 1 || g_setting_backlight_on_tx_rx == 3)
|
||||
backlight_turn_on(backlight_tx_rx_time_500ms);
|
||||
|
||||
if (g_eeprom.dual_watch != DUAL_WATCH_OFF)
|
||||
{ // dual-RX is enabled
|
||||
g_dual_watch_delay_10ms = dual_watch_delay_after_tx_10ms;
|
||||
if (g_dual_watch_delay_10ms < (g_eeprom.scan_hold_time_500ms * 50))
|
||||
g_dual_watch_delay_10ms = g_eeprom.scan_hold_time_500ms * 50;
|
||||
}
|
||||
|
||||
// if DTMF is enabled when TX'ing, it changes the TX audio filtering ! .. 1of11
|
||||
// so MAKE SURE that DTMF is disabled - until needed
|
||||
BK4819_DisableDTMF();
|
||||
@ -186,50 +196,49 @@ void FUNCTION_Select(function_type_t Function)
|
||||
|
||||
// clear the DTMF RX live decoder buffer
|
||||
g_dtmf_rx_live_timeout = 0;
|
||||
g_dtmf_rx_live_timeout = 0;
|
||||
memset(g_dtmf_rx_live, 0, sizeof(g_dtmf_rx_live));
|
||||
|
||||
#if defined(ENABLE_FMRADIO)
|
||||
#ifdef ENABLE_FMRADIO
|
||||
// disable the FM radio
|
||||
if (g_fm_radio_mode)
|
||||
BK1080_Init(0, false);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_ALARM
|
||||
if (g_alarm_state == ALARM_STATE_TXALARM && g_eeprom.alarm_mode != ALARM_MODE_TONE)
|
||||
{
|
||||
g_alarm_state = ALARM_STATE_ALARM;
|
||||
|
||||
GUI_DisplayScreen();
|
||||
|
||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
|
||||
|
||||
SYSTEM_DelayMs(20);
|
||||
BK4819_PlayTone(500, 0);
|
||||
SYSTEM_DelayMs(2);
|
||||
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
|
||||
|
||||
g_enable_speaker = true;
|
||||
|
||||
SYSTEM_DelayMs(60);
|
||||
BK4819_ExitTxMute();
|
||||
|
||||
g_alarm_tone_counter = 0;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
g_update_status = true;
|
||||
|
||||
GUI_DisplayScreen();
|
||||
|
||||
#ifdef ENABLE_ALARM
|
||||
if (g_alarm_state == ALARM_STATE_TXALARM && g_eeprom.alarm_mode != ALARM_MODE_TONE)
|
||||
{ // enable the alarm tone but not the TX
|
||||
|
||||
g_alarm_state = ALARM_STATE_ALARM;
|
||||
|
||||
GUI_DisplayScreen();
|
||||
|
||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||
|
||||
SYSTEM_DelayMs(20);
|
||||
BK4819_StartTone1(500, 28, true);
|
||||
SYSTEM_DelayMs(2);
|
||||
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||
|
||||
g_enable_speaker = true;
|
||||
|
||||
SYSTEM_DelayMs(60);
|
||||
BK4819_ExitTxMute();
|
||||
|
||||
g_alarm_tone_counter_10ms = 0;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (g_current_vfo->scrambling_type == 0 || !g_setting_scramble_enable)
|
||||
BK4819_DisableScramble();
|
||||
|
||||
RADIO_enableTX(false);
|
||||
|
||||
DTMF_Reply();
|
||||
|
||||
if (g_current_vfo->dtmf_ptt_id_tx_mode == PTT_ID_APOLLO)
|
||||
BK4819_PlaySingleTone(APOLLO_TONE1_HZ, APOLLO_TONE_MS, 0, g_eeprom.dtmf_side_tone);
|
||||
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
if (g_alarm_state != ALARM_STATE_OFF)
|
||||
{
|
||||
@ -241,31 +250,28 @@ void FUNCTION_Select(function_type_t Function)
|
||||
if (g_alarm_state == ALARM_STATE_TXALARM)
|
||||
BK4819_TransmitTone(true, 500);
|
||||
#endif
|
||||
|
||||
SYSTEM_DelayMs(2);
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
|
||||
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||
|
||||
#ifdef ENABLE_ALARM
|
||||
g_alarm_tone_counter = 0;
|
||||
g_alarm_tone_counter_10ms = 0;
|
||||
#endif
|
||||
|
||||
g_enable_speaker = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
if (!DTMF_Reply())
|
||||
if (g_current_vfo->dtmf_ptt_id_tx_mode == PTT_ID_APOLLO)
|
||||
BK4819_PlayTone(APOLLO_TONE1_HZ, APOLLO_TONE_MS, 0);
|
||||
|
||||
if (g_current_vfo->scrambling_type > 0 && g_setting_scramble_enable)
|
||||
BK4819_EnableScramble(g_current_vfo->scrambling_type - 1);
|
||||
else
|
||||
BK4819_DisableScramble();
|
||||
|
||||
if (g_setting_backlight_on_tx_rx == 1 || g_setting_backlight_on_tx_rx == 3)
|
||||
backlight_turn_on(backlight_tx_rx_time_500ms);
|
||||
|
||||
if (g_eeprom.dual_watch != DUAL_WATCH_OFF)
|
||||
{ // dual-RX is enabled
|
||||
g_dual_watch_delay_10ms = dual_watch_delay_after_tx_10ms;
|
||||
if (g_dual_watch_delay_10ms < (g_eeprom.scan_hold_time_500ms * 50))
|
||||
g_dual_watch_delay_10ms = g_eeprom.scan_hold_time_500ms * 50;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case FUNCTION_PANADAPTER:
|
||||
|
Reference in New Issue
Block a user