0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 22:31:25 +03:00

Added compile option for the faster newer bigger larger manual up/dn frequency smootching

This commit is contained in:
OneOfEleven 2023-10-16 10:47:43 +01:00
parent 916be495d4
commit f69a997ac1
6 changed files with 151 additions and 119 deletions

View File

@ -39,6 +39,7 @@ ENABLE_CODE_SEARCH_TIMEOUT := 1
ENABLE_AM_FIX := 1 ENABLE_AM_FIX := 1
ENABLE_AM_FIX_SHOW_DATA := 1 ENABLE_AM_FIX_SHOW_DATA := 1
ENABLE_SQUELCH_MORE_SENSITIVE := 1 ENABLE_SQUELCH_MORE_SENSITIVE := 1
ENABLE_SQ_OPEN_WHITH_UP_DN_BUTTS := 1
ENABLE_FASTER_CHANNEL_SCAN := 1 ENABLE_FASTER_CHANNEL_SCAN := 1
ENABLE_RSSI_BAR := 1 ENABLE_RSSI_BAR := 1
ENABLE_SHOW_TX_TIMEOUT := 0 ENABLE_SHOW_TX_TIMEOUT := 0
@ -342,6 +343,9 @@ endif
ifeq ($(ENABLE_SQUELCH_MORE_SENSITIVE),1) ifeq ($(ENABLE_SQUELCH_MORE_SENSITIVE),1)
CFLAGS += -DENABLE_SQUELCH_MORE_SENSITIVE CFLAGS += -DENABLE_SQUELCH_MORE_SENSITIVE
endif endif
ifeq ($(ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS),1)
CFLAGS += -DENABLE_SQ_OPEN_WITH_UP_DN_BUTTS
endif
ifeq ($(ENABLE_FASTER_CHANNEL_SCAN),1) ifeq ($(ENABLE_FASTER_CHANNEL_SCAN),1)
CFLAGS += -DENABLE_FASTER_CHANNEL_SCAN CFLAGS += -DENABLE_FASTER_CHANNEL_SCAN
endif endif

View File

@ -70,6 +70,7 @@ ENABLE_CODE_SEARCH_TIMEOUT := 0 timeout if CTCSS/CDCSS not found when
ENABLE_AM_FIX := 1 dynamically adjust the front end gains when in AM mode to helo prevent AM demodulator saturation, ignore the on-screen RSSI level (for now) ENABLE_AM_FIX := 1 dynamically adjust the front end gains when in AM mode to helo prevent AM demodulator saturation, ignore the on-screen RSSI level (for now)
ENABLE_AM_FIX_SHOW_DATA := 1 show debug data for the AM fix (still tweaking it) ENABLE_AM_FIX_SHOW_DATA := 1 show debug data for the AM fix (still tweaking it)
ENABLE_SQUELCH_MORE_SENSITIVE := 1 make squelch levels a little bit more sensitive - I plan to let user adjust the values themselves ENABLE_SQUELCH_MORE_SENSITIVE := 1 make squelch levels a little bit more sensitive - I plan to let user adjust the values themselves
ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1 open the squelch when holding down UP or DN buttons when in frequency mode
ENABLE_FASTER_CHANNEL_SCAN := 1 increases the channel scan speed, but the squelch is also made more twitchy ENABLE_FASTER_CHANNEL_SCAN := 1 increases the channel scan speed, but the squelch is also made more twitchy
ENABLE_RSSI_BAR := 1 enable a dBm/Sn RSSI bar graph level inplace of the little antenna symbols ENABLE_RSSI_BAR := 1 enable a dBm/Sn RSSI bar graph level inplace of the little antenna symbols
ENABLE_SHOW_TX_TIMEOUT := 0 show the remainng TX time ENABLE_SHOW_TX_TIMEOUT := 0 show the remainng TX time

View File

@ -674,7 +674,16 @@ void APP_stop_scan(void)
static void APP_next_freq(void) static void APP_next_freq(void)
{ {
g_rx_vfo->freq_config_rx.frequency = APP_set_frequency_by_step(g_rx_vfo, g_scan_state_dir); frequency_band_t new_band;
const frequency_band_t old_band = FREQUENCY_GetBand(g_rx_vfo->freq_config_rx.frequency);
const uint32_t frequency = APP_set_frequency_by_step(g_rx_vfo, g_scan_state_dir);
new_band = FREQUENCY_GetBand(frequency);
g_rx_vfo->freq_config_rx.frequency = frequency;
if (new_band != old_band)
{ // original slow method
RADIO_ApplyOffset(g_rx_vfo); RADIO_ApplyOffset(g_rx_vfo);
RADIO_ConfigureSquelchAndOutputPower(g_rx_vfo); RADIO_ConfigureSquelchAndOutputPower(g_rx_vfo);
@ -685,6 +694,18 @@ static void APP_next_freq(void)
#else #else
g_scan_pause_delay_in_10ms = scan_pause_delay_in_6_10ms; g_scan_pause_delay_in_10ms = scan_pause_delay_in_6_10ms;
#endif #endif
}
else
{ // don't need to go through all the other stuff .. lets speed things up !!
BK4819_set_rf_frequency(frequency, true);
#ifdef ENABLE_FASTER_CHANNEL_SCAN
g_scan_pause_delay_in_10ms = 8; // 80ms
#else
g_scan_pause_delay_in_10ms = scan_pause_delay_in_6_10ms;
#endif
}
g_scan_keep_frequency = false; g_scan_keep_frequency = false;
g_update_display = true; g_update_display = true;
@ -1557,7 +1578,7 @@ void APP_time_slice_10ms(void)
if (g_flag_save_channel) if (g_flag_save_channel)
{ {
SETTINGS_SaveChannel(g_tx_vfo->channel_save, g_eeprom.tx_vfo, g_tx_vfo, g_flag_save_channel); SETTINGS_SaveChannel(g_tx_vfo->channel_save, g_eeprom.tx_vfo, g_tx_vfo, g_flag_save_channel ? 1 : 0);
g_flag_save_channel = false; g_flag_save_channel = false;
RADIO_ConfigureChannel(g_eeprom.tx_vfo, VFO_CONFIGURE); RADIO_ConfigureChannel(g_eeprom.tx_vfo, VFO_CONFIGURE);

View File

@ -718,20 +718,25 @@ static void MAIN_Key_STAR(bool key_pressed, bool key_held)
static void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Direction) static void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Direction)
{ {
#ifdef ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS
static bool monitor_was_enabled = false; static bool monitor_was_enabled = false;
#endif
uint8_t Channel = g_eeprom.screen_channel[g_eeprom.tx_vfo]; uint8_t Channel = g_eeprom.screen_channel[g_eeprom.tx_vfo];
// only update eeprom when the key is released (saves wear and tear)
if (!key_pressed && g_scan_state_dir == SCAN_STATE_DIR_OFF && IS_NOT_NOAA_CHANNEL(Channel) && IS_FREQ_CHANNEL(Channel)) if (!key_pressed && g_scan_state_dir == SCAN_STATE_DIR_OFF && IS_NOT_NOAA_CHANNEL(Channel) && IS_FREQ_CHANNEL(Channel))
{ {
#ifdef ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS
if (key_held && !key_pressed && !monitor_was_enabled && g_current_function == FUNCTION_MONITOR) if (key_held && !key_pressed && !monitor_was_enabled && g_current_function == FUNCTION_MONITOR)
{ // re-enable the squelch { // re-enable the squelch
APP_start_listening(FUNCTION_RECEIVE, false); APP_start_listening(FUNCTION_RECEIVE, false);
g_monitor_enabled = false; g_monitor_enabled = false;
} }
#endif
SETTINGS_SaveChannel(g_tx_vfo->channel_save, g_eeprom.tx_vfo, g_tx_vfo, 1); // only update eeprom when the key is released - saves a LOT of wear and tear on the little eeprom
g_flag_save_channel = 1;
//SETTINGS_SaveChannel(g_tx_vfo->channel_save, g_eeprom.tx_vfo, g_tx_vfo, 1);
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG) #if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
// UART_printf("save chan\r\n"); // UART_printf("save chan\r\n");
@ -781,9 +786,8 @@ static void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t D
if (IS_FREQ_CHANNEL(Channel)) if (IS_FREQ_CHANNEL(Channel))
{ // step/down in frequency { // step/down in frequency
const frequency_band_t old_band = FREQUENCY_GetBand(g_tx_vfo->freq_config_rx.frequency);
frequency_band_t new_band; frequency_band_t new_band;
const frequency_band_t old_band = FREQUENCY_GetBand(g_tx_vfo->freq_config_rx.frequency);
const uint32_t frequency = APP_set_frequency_by_step(g_tx_vfo, Direction); const uint32_t frequency = APP_set_frequency_by_step(g_tx_vfo, Direction);
if (RX_freq_check(frequency) < 0) if (RX_freq_check(frequency) < 0)
@ -797,12 +801,13 @@ static void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t D
g_tx_vfo->freq_config_rx.frequency = frequency; g_tx_vfo->freq_config_rx.frequency = frequency;
if (new_band != old_band) if (new_band != old_band)
{ { // original slow method
g_request_save_channel = 1; g_request_save_channel = 1;
} }
else else
{ // don't need to go through all the other stuff { // don't need to go through all the other stuff .. lets speed things up !!
#ifdef ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS
if (!key_held && key_pressed) if (!key_held && key_pressed)
monitor_was_enabled = g_monitor_enabled; monitor_was_enabled = g_monitor_enabled;
@ -811,6 +816,7 @@ static void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t D
APP_start_listening(FUNCTION_MONITOR, false); APP_start_listening(FUNCTION_MONITOR, false);
g_monitor_enabled = true; g_monitor_enabled = true;
} }
#endif
BK4819_set_rf_frequency(frequency, true); BK4819_set_rf_frequency(frequency, true);
//BK4819_PickRXFilterPathBasedOnFrequency(frequency); //BK4819_PickRXFilterPathBasedOnFrequency(frequency);

Binary file not shown.

Binary file not shown.