0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 06:39:49 +03:00

reduce FM radio compile size if only 1 band used

This commit is contained in:
OneOfEleven
2023-10-30 12:31:36 +00:00
parent c03ac606f1
commit 9a7e03ced5
7 changed files with 58 additions and 44 deletions

View File

@ -346,7 +346,8 @@ void ACTION_Scan(bool bRestart)
if (g_current_function != FUNCTION_TRANSMIT)
{
if (g_fm_radio_mode)
{
{ // return normal service
FM_TurnOff();
g_input_box_index = 0;
@ -359,6 +360,8 @@ void ACTION_Scan(bool bRestart)
return;
}
// switch to FM radio mode
g_monitor_enabled = false;
RADIO_select_vfos();

View File

@ -469,11 +469,6 @@ bool APP_start_listening(void)
if (g_setting_backlight_on_tx_rx >= 2)
backlight_turn_on(backlight_tx_rx_time_500ms);
#ifdef ENABLE_FMRADIO
if (g_fm_radio_mode)
BK1080_Init(0, false);
#endif
#ifdef ENABLE_MDC1200
// MDC1200_reset_rx();
#endif
@ -558,6 +553,11 @@ bool APP_start_listening(void)
AUDIO_set_mod_mode(g_rx_vfo->am_mode);
#endif
#ifdef ENABLE_FMRADIO
if (g_fm_radio_mode)
BK1080_Init(0, false); // disable the FM radio audio
#endif
// enable the speaker
g_speaker_enabled = true;
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);

View File

@ -706,6 +706,7 @@ void FM_Start(void)
g_fm_scan_state = FM_SCAN_OFF;
g_fm_restore_tick_10ms = 0;
// enable the FM radio chip and audio
BK1080_Init(g_eeprom.fm_frequency_playing, true);
g_speaker_enabled = true;