0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 06:39:49 +03:00
This commit is contained in:
OneOfEleven
2023-11-09 05:59:50 +00:00
parent 5c17a33e3c
commit b704e7efa3
18 changed files with 164 additions and 120 deletions

View File

@ -705,7 +705,8 @@ static void AIRCOPY_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
g_rx_vfo->freq_config_rx.frequency = Frequency;
g_rx_vfo->freq_config_tx.frequency = Frequency;
RADIO_ConfigureSquelchAndOutputPower(g_rx_vfo);
RADIO_ConfigureSquelch(g_rx_vfo);
// RADIO_ConfigureTXPower(g_rx_vfo);
g_current_vfo = g_rx_vfo;

View File

@ -563,6 +563,10 @@ bool APP_start_listening(void)
AUDIO_set_mod_mode(g_rx_vfo->channel.mod_mode);
#endif
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
UART_printf("mode %u\r\n", g_rx_vfo->channel.mod_mode);
#endif
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
if (g_current_display_screen != DISPLAY_MENU)
@ -600,7 +604,7 @@ void APP_stop_scan(void)
{ // revert to where we were when starting the scan
if (g_scan_next_channel <= USER_CHANNEL_LAST)
{ // we were channel hopping
{ // we were channel scanning
if (g_scan_restore_channel != 0xff)
{
@ -608,7 +612,7 @@ void APP_stop_scan(void)
g_eeprom.config.setting.indices.vfo[g_rx_vfo_num].screen = g_scan_restore_channel;
RADIO_configure_channel(g_rx_vfo_num, VFO_CONFIGURE_RELOAD);
RADIO_ConfigureSquelch(g_rx_vfo);
RADIO_setup_registers(true);
}
}
@ -622,7 +626,7 @@ void APP_stop_scan(void)
g_rx_vfo->freq_in_channel = SETTINGS_find_channel(g_rx_vfo->freq_config_rx.frequency);
RADIO_ApplyOffset(g_rx_vfo, false);
RADIO_ConfigureSquelchAndOutputPower(g_rx_vfo);
RADIO_ConfigureSquelch(g_rx_vfo);
RADIO_setup_registers(true);
}
@ -634,7 +638,7 @@ void APP_stop_scan(void)
if (g_rx_vfo->channel_save > USER_CHANNEL_LAST)
{ // frequency mode
RADIO_ApplyOffset(g_rx_vfo, false);
RADIO_ConfigureSquelchAndOutputPower(g_rx_vfo);
RADIO_ConfigureSquelch(g_rx_vfo);
SETTINGS_save_channel(g_rx_vfo->channel_save, g_rx_vfo_num, g_rx_vfo, 1);
return;
}
@ -688,8 +692,7 @@ static void APP_next_freq(void)
// original slower method
RADIO_ApplyOffset(g_tx_vfo, false);
RADIO_ConfigureSquelchAndOutputPower(g_tx_vfo);
// RADIO_ConfigureSquelch(g_tx_vfo);
RADIO_setup_registers(true);
#ifdef ENABLE_FASTER_CHANNEL_SCAN
@ -705,7 +708,7 @@ static void APP_next_freq(void)
BK4819_set_rf_filter_path(g_tx_vfo->freq_config_rx.frequency);
RADIO_ApplyOffset(g_tx_vfo, false);
RADIO_ConfigureSquelchAndOutputPower(g_tx_vfo);
// RADIO_ConfigureSquelch(g_tx_vfo);
#ifdef ENABLE_FASTER_CHANNEL_SCAN
//g_scan_tick_10ms = 10; // 100ms
@ -811,7 +814,6 @@ static void APP_next_channel(void)
g_eeprom.config.setting.indices.vfo[g_rx_vfo_num].screen = g_scan_next_channel;
RADIO_configure_channel(g_rx_vfo_num, VFO_CONFIGURE_RELOAD);
RADIO_setup_registers(true);
g_update_display = true;
@ -1731,6 +1733,7 @@ void APP_process_transmit(void)
g_alarm_state = ALARM_STATE_ALARM;
RADIO_enable_CxCSS_tail();
RADIO_ConfigureTXPower(g_tx_vfo);
BK4819_SetupPowerAmplifier(0, 0);
BK4819_set_GPIO_pin(BK4819_GPIO1_PIN29_PA_ENABLE, false); // PA off
BK4819_Enable_AfDac_DiscMode_TxDsp();

View File

@ -142,8 +142,8 @@ void toggle_chan_scanlist(void)
RADIO_select_vfos();
RADIO_ApplyOffset(g_tx_vfo, false);
RADIO_ConfigureSquelchAndOutputPower(g_tx_vfo);
RADIO_ConfigureSquelch(g_tx_vfo);
// RADIO_ConfigureTXPower(g_tx_vfo);
RADIO_setup_registers(true);
// find the first channel that contains this frequency
@ -459,7 +459,7 @@ void MAIN_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
g_key_input_count_down = key_input_timeout_500ms;
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
UART_printf("key0 %u\r\n", Key);
// UART_printf("key0 %u\r\n", Key);
#endif
if (key_held)
@ -524,7 +524,7 @@ void MAIN_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
const unsigned int chan = ((g_input_box[0] * 100) + (g_input_box[1] * 10) + g_input_box[2]) - 1;
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
UART_printf("key2 %u %u\r\n", chan, g_input_box_index);
// UART_printf("key2 %u %u\r\n", chan, g_input_box_index);
#endif
if (g_input_box_index < 3)
@ -564,10 +564,12 @@ void MAIN_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
NUMBER_Get(g_input_box, &freq);
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
UART_printf("key2 %u %u\r\n", freq, g_input_box_index);
// UART_printf("key3 %u %u\r\n", freq, g_input_box_index);
#endif
if (g_input_box_index < 6)
// if (g_input_box_index < 6)
// if (g_input_box_index < 7)
if (g_input_box_index < 8)
{
#ifdef ENABLE_VOICE
g_another_voice_id = (voice_id_t)Key;
@ -1063,7 +1065,8 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t directio
#if 0
RADIO_ApplyOffset(g_tx_vfo, false);
RADIO_ConfigureSquelchAndOutputPower(g_tx_vfo);
RADIO_ConfigureSquelch(g_tx_vfo);
// RADIO_ConfigureTXPower(g_tx_vfo);
// original slow method
g_request_save_channel = 1;
@ -1088,7 +1091,8 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t directio
BK4819_set_rf_filter_path(freq); // set the proper LNA/PA filter path
RADIO_ApplyOffset(g_tx_vfo, false);
RADIO_ConfigureSquelchAndOutputPower(g_tx_vfo);
RADIO_ConfigureSquelch(g_tx_vfo);
// RADIO_ConfigureTXPower(g_tx_vfo);
#endif
return;

View File

@ -398,11 +398,13 @@ void MENU_AcceptSetting(void)
case MENU_SQL:
g_eeprom.config.setting.squelch_level = g_sub_menu_selection;
RADIO_ConfigureSquelch(g_tx_vfo);
g_vfo_configure_mode = VFO_CONFIGURE;
break;
case MENU_CHAN_SQL:
g_tx_vfo->channel.squelch_level = g_sub_menu_selection;
RADIO_ConfigureSquelch(g_tx_vfo);
g_request_save_channel = 1;
return;