diff --git a/app/action.c b/app/action.c index 4c0397e..4cf5968 100644 --- a/app/action.c +++ b/app/action.c @@ -119,7 +119,7 @@ void ACTION_Monitor(void) g_monitor_enabled = false; - if (!g_speaker_enabled) + if (!g_squelch_open) GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); if (g_scan_state_dir != SCAN_STATE_DIR_OFF) diff --git a/app/app.c b/app/app.c index c83ea35..a99415a 100644 --- a/app/app.c +++ b/app/app.c @@ -404,9 +404,6 @@ Skip: break; case END_OF_RX_MODE_END: - if (!g_monitor_enabled) - g_speaker_enabled = false; - RADIO_setup_registers(true); #ifdef ENABLE_NOAA @@ -421,10 +418,7 @@ Skip: if (g_eeprom.tail_note_elimination) { - if (!g_monitor_enabled) - g_speaker_enabled = false; - - if (!g_speaker_enabled && !g_monitor_enabled) + if (!g_squelch_open && !g_monitor_enabled) GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); g_tail_tone_elimination_tick_10ms = 20; // 200ms @@ -542,6 +536,8 @@ bool APP_start_listening(void) FUNCTION_Select(FUNCTION_RECEIVE); + GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); + #ifdef ENABLE_VOICE #ifdef MUTE_AUDIO_FOR_VOICE if (g_voice_write_index == 0) @@ -558,10 +554,6 @@ bool APP_start_listening(void) BK1080_Init(0, false); // disable the FM radio audio #endif - // enable the speaker - g_speaker_enabled = true; - GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); - if (g_current_display_screen != DISPLAY_MENU) GUI_SelectNextDisplay(DISPLAY_MAIN); @@ -706,7 +698,8 @@ static void APP_next_freq(void) BK4819_set_rf_filter_path(frequency); #ifdef ENABLE_FASTER_CHANNEL_SCAN - g_scan_pause_tick_10ms = 10; // 100ms +// g_scan_pause_tick_10ms = 10; // 100ms + g_scan_pause_tick_10ms = 6; // 60ms #else g_scan_pause_tick_10ms = scan_pause_freq_10ms; #endif @@ -983,6 +976,9 @@ void APP_process_radio_interrupts(void) BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_GREEN, false); // LED off + if (!g_monitor_enabled) + GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); + #if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG) UART_SendText("sq close\r\n"); #endif @@ -1035,12 +1031,13 @@ void APP_end_tx(void) #endif } - g_speaker_enabled = false; - RADIO_setup_registers(false); if (g_monitor_enabled) APP_start_listening(); + + if (g_squelch_open || g_monitor_enabled) + GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); } #ifdef ENABLE_VOX @@ -1373,7 +1370,7 @@ void APP_cancel_user_input_modes(void) #if defined(ENABLE_ALARM) || defined(ENABLE_TX1750) static void APP_alarm_off(void) { - if (!g_speaker_enabled && !g_monitor_enabled) + if (!g_squelch_open && !g_monitor_enabled) GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); if (g_eeprom.alarm_mode == ALARM_MODE_TONE) @@ -1392,7 +1389,7 @@ void APP_cancel_user_input_modes(void) RADIO_setup_registers(true); - if (!g_monitor_enabled && !g_speaker_enabled) + if (!g_squelch_open && !g_monitor_enabled) GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); else GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); @@ -1676,7 +1673,6 @@ void APP_process_transmit(void) BK4819_TransmitTone(true, 500); SYSTEM_DelayMs(2); - g_speaker_enabled = true; GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); g_alarm_tone_counter_10ms = 0; @@ -2122,7 +2118,7 @@ void APP_time_slice_500ms(void) { if (--g_fm_resume_tick_500ms == 0) { - RADIO_Setg_vfo_state(VFO_STATE_NORMAL); + RADIO_set_vfo_state(VFO_STATE_NORMAL); if (g_current_function != FUNCTION_RECEIVE && !g_monitor_enabled && @@ -2241,7 +2237,7 @@ void APP_time_slice_10ms(void) AUDIO_PlayBeep(BEEP_880HZ_60MS_TRIPLE_BEEP); - RADIO_Setg_vfo_state(VFO_STATE_TIMEOUT); + RADIO_set_vfo_state(VFO_STATE_TIMEOUT); GUI_DisplayScreen(); } @@ -2406,7 +2402,7 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const // reset the state so as to remove it from the screen if (Key != KEY_INVALID && Key != KEY_PTT) - RADIO_Setg_vfo_state(VFO_STATE_NORMAL); + RADIO_set_vfo_state(VFO_STATE_NORMAL); #if 0 // remember the current backlight state (on / off) const bool backlight_was_on = GPIO_CheckBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); @@ -2619,7 +2615,6 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const { if (!key_pressed) { -// g_speaker_enabled = false; GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); BK4819_ExitDTMF_TX(false); @@ -2634,7 +2629,6 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const { if (g_eeprom.dtmf_side_tone) { // user will here the DTMF tones in speaker -// g_speaker_enabled = true; GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); } @@ -2835,7 +2829,7 @@ Skip: g_vfo_rssi_bar_level[0] = 0; g_vfo_rssi_bar_level[1] = 0; - if (g_speaker_enabled || g_monitor_enabled) + if (g_squelch_open || g_monitor_enabled) APP_start_listening(); g_flag_reconfigure_vfos = false; diff --git a/app/dtmf.c b/app/dtmf.c index 8c5858f..40ae15a 100644 --- a/app/dtmf.c +++ b/app/dtmf.c @@ -439,7 +439,6 @@ bool DTMF_Reply(void) if (g_eeprom.dtmf_side_tone) { // the user will also hear the transmitted tones - g_speaker_enabled = true; GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); } @@ -455,7 +454,6 @@ bool DTMF_Reply(void) g_eeprom.dtmf_code_persist_time, g_eeprom.dtmf_code_interval_time); - g_speaker_enabled = false; GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); BK4819_ExitDTMF_TX(false); diff --git a/app/fm.c b/app/fm.c index 14ac39e..198b2c0 100644 --- a/app/fm.c +++ b/app/fm.c @@ -112,7 +112,6 @@ void FM_erase_channels(void) void FM_tune(uint16_t frequency, const fm_scan_state_dir_t scan_state_dir, const bool flag) { - g_speaker_enabled = false; GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); g_fm_play_tick_10ms = (g_fm_scan_state_dir == FM_SCAN_STATE_DIR_OFF) ? fm_play_noscan_10ms : fm_play_scan_10ms; @@ -162,7 +161,6 @@ void FM_stop_scan(void) g_fm_schedule = false; g_ask_to_save = false; - g_speaker_enabled = true; GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); g_update_display = true; @@ -230,7 +228,6 @@ void FM_scan(void) if (!g_eeprom.fm_channel_mode) g_eeprom.fm_selected_frequency = g_eeprom.fm_frequency_playing; - g_speaker_enabled = true; GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); GUI_SelectNextDisplay(DISPLAY_FM); @@ -267,7 +264,6 @@ void FM_turn_on(void) // enable the FM radio chip BK1080_Init(g_eeprom.fm_frequency_playing, true); - g_speaker_enabled = true; GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); g_update_display = true; @@ -280,11 +276,8 @@ void FM_turn_off(void) g_fm_scan_state_dir = FM_SCAN_STATE_DIR_OFF; g_fm_restore_tick_10ms = 0; - if (!g_monitor_enabled) - { - g_speaker_enabled = false; + if (!g_squelch_open && !g_monitor_enabled) GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); - } // disable the FM chip BK1080_Init(0, false); diff --git a/app/generic.c b/app/generic.c index 9c4167d..811dfec 100644 --- a/app/generic.c +++ b/app/generic.c @@ -127,7 +127,7 @@ void GENERIC_Key_PTT(bool key_pressed) g_vox_noise_detected = false; #endif - RADIO_Setg_vfo_state(VFO_STATE_NORMAL); + RADIO_set_vfo_state(VFO_STATE_NORMAL); if (g_current_display_screen != DISPLAY_MENU) // 1of11 .. don't close the menu g_request_display_screen = DISPLAY_MAIN; diff --git a/app/main.c b/app/main.c index 43fc66e..df1db70 100644 --- a/app/main.c +++ b/app/main.c @@ -52,7 +52,7 @@ bool scanning_paused(void) { // scanning isn't paused return false; } - + return true; } @@ -229,7 +229,7 @@ void processFKeyFunction(const key_code_t Key) #endif } - + break; case KEY_1: // BAND @@ -251,7 +251,7 @@ void processFKeyFunction(const key_code_t Key) else Band = BAND6_400MHz; // jump to next band g_tx_vfo->band = Band; - + g_eeprom.screen_channel[Vfo] = FREQ_CHANNEL_FIRST + Band; g_eeprom.freq_channel[Vfo] = FREQ_CHANNEL_FIRST + Band; @@ -694,10 +694,10 @@ void MAIN_Key_EXIT(bool key_pressed, bool key_held) if (!key_held) return; - + if (key_pressed) return; - + #ifdef ENABLE_FMRADIO if (g_fm_radio_mode) { @@ -705,7 +705,7 @@ void MAIN_Key_EXIT(bool key_pressed, bool key_held) return; } #endif - + if (g_input_box_index > 0 || g_dtmf_input_box_index > 0 || g_dtmf_input_mode) { // cancel key input mode (channel/frequency entry) g_dtmf_input_mode = false; @@ -878,7 +878,7 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio { // re-enable the squelch g_monitor_enabled = false; - +// GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); APP_start_listening(); } #endif @@ -891,9 +891,9 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio SETTINGS_save_channel(g_tx_vfo->channel_save, g_eeprom.tx_vfo, g_tx_vfo, 1); RADIO_ApplyOffset(g_tx_vfo, true); - + #if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG) - UART_printf("save chan %u\r\n", g_tx_vfo->channel_save); +// UART_printf("save chan %u\r\n", g_tx_vfo->channel_save); #endif } } @@ -988,7 +988,8 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio if (key_held && key_pressed && !monitor_was_enabled) { // open the squelch if the user holds the key down g_monitor_enabled = true; - APP_start_listening(); + GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); +// APP_start_listening(); } #endif @@ -1000,17 +1001,18 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio } // channel mode - + g_tx_vfo->freq_in_channel = 0xff; #ifdef ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS if (!key_held && key_pressed) monitor_was_enabled = g_monitor_enabled; - + if (key_held && key_pressed && !monitor_was_enabled) { // open the squelch if the user holds the key down g_monitor_enabled = true; - APP_start_listening(); + GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); +// APP_start_listening(); } #endif @@ -1049,20 +1051,18 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio return; } -// g_speaker_enabled = false; -// g_monitor_enabled = false; GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); // jump to the next channel APP_channel_next(false, Direction); // go NOW - g_scan_pause_tick_10ms = 0; + g_scan_pause_tick_10ms = 0; g_scan_pause_time_mode = false; g_squelch_open = false; g_rx_reception_mode = RX_MODE_NONE; FUNCTION_Select(FUNCTION_FOREGROUND); - + g_ptt_was_released = true; } diff --git a/audio.c b/audio.c index 3ae78d4..4f6cce2 100644 --- a/audio.c +++ b/audio.c @@ -112,6 +112,7 @@ void AUDIO_PlayBeep(beep_type_t Beep) if (g_flash_light_state == FLASHLIGHT_SOS || g_current_function == FUNCTION_RECEIVE || g_monitor_enabled || + g_squelch_open || GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER)) { return; @@ -119,7 +120,7 @@ void AUDIO_PlayBeep(beep_type_t Beep) #ifdef ENABLE_AIRCOPY // if (g_current_display_screen == DISPLAY_AIRCOPY || g_aircopy_state != AIRCOPY_READY) -// return; +// return; #endif // GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); @@ -248,7 +249,7 @@ void AUDIO_PlayBeep(beep_type_t Beep) BK4819_Sleep(); } else - if (g_speaker_enabled || g_monitor_enabled) + if (g_squelch_open || g_monitor_enabled) { GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); } @@ -344,7 +345,7 @@ void AUDIO_PlayBeep(beep_type_t Beep) BK1080_Mute(false); #endif - if (!g_speaker_enabled) + if (!g_squelch_open && !g_monitor_enabled) GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); g_voice_write_index = 0; @@ -492,7 +493,7 @@ void AUDIO_PlayBeep(beep_type_t Beep) BK1080_Mute(false); #endif - if (!g_speaker_enabled) + if (!g_squelch_open && !g_monitor_enabled) GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); // ********************** diff --git a/driver/bk4819.c b/driver/bk4819.c index d305251..554aa4d 100644 --- a/driver/bk4819.c +++ b/driver/bk4819.c @@ -766,22 +766,9 @@ void BK4819_set_rf_frequency(const uint32_t frequency, const bool trigger_update BK4819_WriteRegister(0x39, (frequency >> 16) & 0xFFFF); if (trigger_update) - { - // <15> 0 VCO Calibration 1 = enable 0 = disable - // <14> ??? - // <13:10> 0 RX Link 15 = enable 0 = disable - // <9> 0 AF DAC 1 = enable 0 = disable - // <8> 0 DISC Mode 1 = enable 0 = disable - // <7:4> 0 PLL/VCO 15 = enable 0 = disable - // <3> 0 PA Gain 1 = enable 0 = disable - // <2> 0 MIC ADC 1 = enable 0 = disable - // <1> 0 TX DSP 1 = enable 0 = disable - // <0> 0 RX DSP 1 = enable 0 = disable - // - // trigger a PLL/VCO update - // + { // trigger a PLL/VCO update const uint16_t reg = BK4819_ReadRegister(0x30); - BK4819_WriteRegister(0x30, 0); + BK4819_WriteRegister(0x30, reg & ~BK4819_REG_30_ENABLE_VCO_CALIB); BK4819_WriteRegister(0x30, reg); } } @@ -1087,7 +1074,6 @@ void BK4819_StartTone1(const uint16_t frequency, const unsigned int level, const BK4819_ExitTxMute(); - // enable speaker SYSTEM_DelayMs(2); GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); } @@ -1137,7 +1123,7 @@ void BK4819_StopTones(const bool tx) BK4819_ExitTxMute(); -// if (g_speaker_enabled || g_monitor_enabled) +// if (g_squelch_open || g_monitor_enabled) // { // SYSTEM_DelayMs(2); // GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); @@ -1146,11 +1132,11 @@ void BK4819_StopTones(const bool tx) void BK4819_PlayTone(const unsigned int tone_Hz, const unsigned int delay, const unsigned int level) { -// const uint16_t prev_af = BK4819_ReadRegister(0x47); + const uint16_t prev_af = BK4819_ReadRegister(0x47); BK4819_StartTone1(tone_Hz, level, true); SYSTEM_DelayMs(delay - 2); BK4819_StopTones(g_current_function == FUNCTION_TRANSMIT); -// BK4819_WriteRegister(0x47, prev_af); + BK4819_WriteRegister(0x47, prev_af); } void BK4819_PlayRoger(void) @@ -1164,15 +1150,13 @@ void BK4819_PlayRoger(void) const uint32_t tone2_Hz = 1310; #endif -// const uint16_t prev_af = BK4819_ReadRegister(0x47); - + const uint16_t prev_af = BK4819_ReadRegister(0x47); BK4819_StartTone1(tone1_Hz, 96, true); SYSTEM_DelayMs(80 - 2); BK4819_StartTone1(tone2_Hz, 96, false); SYSTEM_DelayMs(80); BK4819_StopTones(true); - -// BK4819_WriteRegister(0x47, prev_af); + BK4819_WriteRegister(0x47, prev_af); } void BK4819_EnterTxMute(void) diff --git a/firmware.bin b/firmware.bin index 2b092c9..2b0b507 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 95fe5fe..1c09e04 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/functions.c b/functions.c index 9bffa8b..5fb31ae 100644 --- a/functions.c +++ b/functions.c @@ -121,7 +121,7 @@ void FUNCTION_Select(function_type_t Function) #ifdef ENABLE_FMRADIO if (g_fm_radio_mode) - g_fm_restore_tick_10ms = fm_restore_10ms; + g_fm_restore_tick_10ms = g_eeprom.scan_hold_time_500ms * 50; #endif if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT || @@ -152,7 +152,6 @@ void FUNCTION_Select(function_type_t Function) if (g_flash_light_state != FLASHLIGHT_SOS) { - g_speaker_enabled = false; g_monitor_enabled = false; GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); } @@ -226,7 +225,6 @@ void FUNCTION_Select(function_type_t Function) BK4819_StartTone1(500, 28, true); SYSTEM_DelayMs(2); - g_speaker_enabled = true; GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); SYSTEM_DelayMs(60); @@ -256,7 +254,6 @@ void FUNCTION_Select(function_type_t Function) SYSTEM_DelayMs(2); - g_speaker_enabled = true; GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); #ifdef ENABLE_ALARM diff --git a/misc.c b/misc.c index 795abd3..7b42d24 100644 --- a/misc.c +++ b/misc.c @@ -27,9 +27,8 @@ const uint8_t obfuscate_array[16] = { const uint8_t fm_resume_500ms = 2500 / 500; // 2.5 seconds const uint8_t fm_radio_500ms = 2000 / 500; // 2 seconds -const uint16_t fm_play_scan_10ms = 40 / 10; // 40ms +const uint16_t fm_play_scan_10ms = 60 / 10; // 60ms const uint16_t fm_play_noscan_10ms = 1200 / 10; // 1.2 seconds -const uint16_t fm_restore_10ms = 5000 / 10; // 5 seconds const uint8_t menu_timeout_500ms = 30000 / 500; // 30 seconds const uint16_t menu_timeout_long_500ms = 120000 / 500; // 2 minutes @@ -43,7 +42,7 @@ const uint8_t dtmf_txstop_500ms = 3000 / 500; // 6 sec const uint8_t serial_config_tick_500ms = 3000 / 500; // 3 seconds -const uint8_t key_input_timeout_500ms = 6000 / 500; // 6 seconds +const uint8_t key_input_timeout_500ms = 6000 / 500; // 6 seconds #ifdef ENABLE_KEYLOCK const uint8_t key_lock_timeout_500ms = 30000 / 500; // 30 seconds #endif @@ -160,7 +159,6 @@ volatile uint16_t g_tail_tone_elimination_tick_10ms; volatile uint16_t g_noaa_tick_10ms; #endif -bool g_speaker_enabled; uint8_t g_key_input_count_down; #ifdef ENABLE_KEYLOCK uint8_t g_key_lock_tick_500ms; diff --git a/misc.h b/misc.h index 5c5c5c7..416e651 100644 --- a/misc.h +++ b/misc.h @@ -116,7 +116,6 @@ extern const uint8_t fm_resume_500ms; extern const uint8_t fm_radio_500ms; extern const uint16_t fm_play_scan_10ms; extern const uint16_t fm_play_noscan_10ms; -extern const uint16_t fm_restore_10ms; extern const uint8_t menu_timeout_500ms; extern const uint16_t menu_timeout_long_500ms; @@ -248,7 +247,7 @@ extern volatile uint16_t g_tail_tone_elimination_tick_10ms; #ifdef ENABLE_NOAA extern volatile uint16_t g_noaa_tick_10ms; #endif -extern bool g_speaker_enabled; + extern uint8_t g_key_input_count_down; #ifdef ENABLE_KEYLOCK diff --git a/radio.c b/radio.c index 22c0b93..96e2b6e 100644 --- a/radio.c +++ b/radio.c @@ -634,7 +634,7 @@ void RADIO_setup_registers(bool switch_to_function_foreground) uint16_t interrupt_mask; uint32_t Frequency; - if (!g_speaker_enabled && !g_monitor_enabled) + if (!g_monitor_enabled) GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); // turn green LED off @@ -833,6 +833,9 @@ void RADIO_setup_registers(bool switch_to_function_foreground) if (switch_to_function_foreground) FUNCTION_Select(FUNCTION_FOREGROUND); + +// if (g_monitor_enabled) +// GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); } #ifdef ENABLE_NOAA @@ -884,7 +887,6 @@ void RADIO_enableTX(const bool fsk_tx) { BK4819_filter_bandwidth_t Bandwidth = g_current_vfo->channel_bandwidth; - g_speaker_enabled = false; GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); BK4819_set_GPIO_pin(BK4819_GPIO0_PIN28_RX_ENABLE, false); @@ -957,7 +959,7 @@ void RADIO_enableTX(const bool fsk_tx) } } -void RADIO_Setg_vfo_state(vfo_state_t State) +void RADIO_set_vfo_state(vfo_state_t State) { if (State == VFO_STATE_NORMAL) { @@ -1047,7 +1049,7 @@ void RADIO_PrepareTX(void) if (State != VFO_STATE_NORMAL) { // TX not allowed - RADIO_Setg_vfo_state(State); + RADIO_set_vfo_state(State); #if defined(ENABLE_ALARM) || defined(ENABLE_TX1750) g_alarm_state = ALARM_STATE_OFF; @@ -1147,7 +1149,6 @@ void RADIO_tx_eot(void) { // end-of-tx if (g_eeprom.dtmf_side_tone) { - g_speaker_enabled = true; GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); SYSTEM_DelayMs(60); @@ -1162,7 +1163,6 @@ void RADIO_tx_eot(void) g_eeprom.dtmf_code_persist_time, g_eeprom.dtmf_code_interval_time); - g_speaker_enabled = false; GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); } else diff --git a/radio.h b/radio.h index 6c18dcf..c711ad3 100644 --- a/radio.h +++ b/radio.h @@ -155,7 +155,7 @@ void RADIO_setup_registers(bool switch_to_function_foreground); #endif void RADIO_enableTX(const bool fsk_tx); -void RADIO_Setg_vfo_state(vfo_state_t State); +void RADIO_set_vfo_state(vfo_state_t State); void RADIO_PrepareTX(void); void RADIO_EnableCxCSS(void); void RADIO_PrepareCssTX(void);