0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 14:21: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

@ -3,49 +3,50 @@
# 0 = disable # 0 = disable
# 1 = enable # 1 = enable
ENABLE_CLANG := 0 ENABLE_CLANG := 0
ENABLE_SWD := 0 ENABLE_SWD := 0
ENABLE_OVERLAY := 0 ENABLE_OVERLAY := 0
ENABLE_LTO := 1 ENABLE_LTO := 1
ENABLE_UART := 1 ENABLE_UART := 1
ENABLE_UART_DEBUG := 1 ENABLE_UART_DEBUG := 1
ENABLE_AIRCOPY := 1 ENABLE_AIRCOPY := 1
ENABLE_AIRCOPY_FREQ := 1 ENABLE_AIRCOPY_FREQ := 1
ENABLE_AIRCOPY_RX_REBOOT := 0 ENABLE_AIRCOPY_RX_REBOOT := 0
ENABLE_FMRADIO := 1 ENABLE_FMRADIO := 1
ENABLE_NOAA := 0 ENABLE_NOAA := 0
ENABLE_VOICE := 0 ENABLE_VOICE := 0
ENABLE_MUTE_RADIO_FOR_VOICE := 1 ENABLE_MUTE_RADIO_FOR_VOICE := 1
ENABLE_VOX := 0 ENABLE_VOX := 0
ENABLE_LOWER_LOW_MID_TX := 1 ENABLE_LOWER_LOW_MID_TX := 1
ENABLE_ALARM := 1 ENABLE_ALARM := 1
ENABLE_TX1750 := 1 ENABLE_TX1750 := 1
ENABLE_PWRON_PASSWORD := 0 ENABLE_PWRON_PASSWORD := 0
ENABLE_RESET_AES_KEY := 1 ENABLE_RESET_AES_KEY := 1
ENABLE_BIG_FREQ := 0 ENABLE_BIG_FREQ := 0
ENABLE_SMALL_BOLD := 1 ENABLE_SMALL_BOLD := 1
ENABLE_KEEP_MEM_NAME := 1 ENABLE_KEEP_MEM_NAME := 1
ENABLE_WIDE_RX := 1 ENABLE_WIDE_RX := 1
ENABLE_1250HZ_STEP := 1 ENABLE_1250HZ_STEP := 1
ENABLE_TX_WHEN_AM := 0 ENABLE_TX_WHEN_AM := 0
ENABLE_F_CAL_MENU := 0 ENABLE_F_CAL_MENU := 0
ENABLE_TX_UNLOCK := 0 ENABLE_TX_UNLOCK := 0
ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1 ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1
ENABLE_BOOT_BEEPS := 0 ENABLE_BOOT_BEEPS := 0
ENABLE_SHOW_CHARGE_LEVEL := 0 ENABLE_SHOW_CHARGE_LEVEL := 0
ENABLE_REVERSE_BAT_SYMBOL := 1 ENABLE_REVERSE_BAT_SYMBOL := 1
ENABLE_FREQ_SEARCH_TIMEOUT := 0 ENABLE_FREQ_SEARCH_TIMEOUT := 0
ENABLE_CODE_SEARCH_TIMEOUT := 1 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_FASTER_CHANNEL_SCAN := 1 ENABLE_SQ_OPEN_WHITH_UP_DN_BUTTS := 1
ENABLE_RSSI_BAR := 1 ENABLE_FASTER_CHANNEL_SCAN := 1
ENABLE_SHOW_TX_TIMEOUT := 0 ENABLE_RSSI_BAR := 1
ENABLE_AUDIO_BAR := 1 ENABLE_SHOW_TX_TIMEOUT := 0
ENABLE_COPY_CHAN_TO_VFO := 1 ENABLE_AUDIO_BAR := 1
#ENABLE_PANADAPTER := 0 ENABLE_COPY_CHAN_TO_VFO := 1
#ENABLE_SINGLE_VFO_CHAN := 0 #ENABLE_PANADAPTER := 0
#ENABLE_SINGLE_VFO_CHAN := 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

@ -34,49 +34,50 @@ us to remove certain firmware features in order to make room in the flash for ot
You'll find the options at the top of "Makefile" ('0' = disable, '1' = enable) .. You'll find the options at the top of "Makefile" ('0' = disable, '1' = enable) ..
``` ```
ENABLE_CLANG := 0 **experimental, builds with clang instead of gcc (LTO will be disabled if you enable this) ENABLE_CLANG := 0 **experimental, builds with clang instead of gcc (LTO will be disabled if you enable this)
ENABLE_SWD := 0 only needed if using CPU's SWD port (debugging/programming) ENABLE_SWD := 0 only needed if using CPU's SWD port (debugging/programming)
ENABLE_OVERLAY := 0 cpu FLASH stuff, not needed ENABLE_OVERLAY := 0 cpu FLASH stuff, not needed
ENABLE_LTO := 0 **experimental, reduces size of compiled firmware but might break EEPROM reads (OVERLAY will be disabled if you enable this) ENABLE_LTO := 0 **experimental, reduces size of compiled firmware but might break EEPROM reads (OVERLAY will be disabled if you enable this)
ENABLE_UART := 1 without this you can't configure radio via PC ENABLE_UART := 1 without this you can't configure radio via PC
ENABLE_UART_DEBUG := 0 just for code debugging, it sends debug info along the USB serial connection (programming lead) ENABLE_UART_DEBUG := 0 just for code debugging, it sends debug info along the USB serial connection (programming lead)
ENABLE_AIRCOPY := 1 clone radio-to-radio via RF ENABLE_AIRCOPY := 1 clone radio-to-radio via RF
ENABLE_AIRCOPY_FREQ := 1 remember what you use for the aircopy frequency ENABLE_AIRCOPY_FREQ := 1 remember what you use for the aircopy frequency
ENABLE_AIRCOPY_RX_REBOOT := 0 auto reboot on an aircopy successful RX completion ENABLE_AIRCOPY_RX_REBOOT := 0 auto reboot on an aircopy successful RX completion
ENABLE_FMRADIO := 1 WBFM VHF broadcast band receiver ENABLE_FMRADIO := 1 WBFM VHF broadcast band receiver
ENABLE_NOAA := 1 everything NOAA (only of any use in the USA) ENABLE_NOAA := 1 everything NOAA (only of any use in the USA)
ENABLE_VOICE := 0 want to hear voices ? ENABLE_VOICE := 0 want to hear voices ?
ENABLE_MUTE_RADIO_FOR_VOICE := 1 mute the radios audio when a voice is playing ENABLE_MUTE_RADIO_FOR_VOICE := 1 mute the radios audio when a voice is playing
ENABLE_VOX := 1 voice operated transmission ENABLE_VOX := 1 voice operated transmission
ENABLE_LOWER_LOW_MID_TX := 1 reduce the low and mid TX power levels (high remains unchanged) ENABLE_LOWER_LOW_MID_TX := 1 reduce the low and mid TX power levels (high remains unchanged)
ENABLE_ALARM := 1 TX alarms ENABLE_ALARM := 1 TX alarms
ENABLE_1750HZ := 1 side key 1750Hz TX tone (older style repeater access) ENABLE_1750HZ := 1 side key 1750Hz TX tone (older style repeater access)
ENABLE_PWRON_PASSWORD := 0 '1' = allow power-on password ENABLE_PWRON_PASSWORD := 0 '1' = allow power-on password
ENABLE_RESET_AES_KEY := 1 '1' = reset/clear the AES key stored in the eeprom (only if it's set) ENABLE_RESET_AES_KEY := 1 '1' = reset/clear the AES key stored in the eeprom (only if it's set)
ENABLE_BIG_FREQ := 0 big font frequencies (like original QS firmware) ENABLE_BIG_FREQ := 0 big font frequencies (like original QS firmware)
ENABLE_SMALL_BOLD := 1 bold channel name/no. (when name + freq channel display mode) ENABLE_SMALL_BOLD := 1 bold channel name/no. (when name + freq channel display mode)
ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)saving memory channel ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)saving memory channel
ENABLE_WIDE_RX := 1 full 18MHz to 1300MHz RX (though front-end/PA not designed for full range) ENABLE_WIDE_RX := 1 full 18MHz to 1300MHz RX (though front-end/PA not designed for full range)
ENABLE_1250HZ_STEP := 1 enable smaller 1.25kHz frequency steps ENABLE_1250HZ_STEP := 1 enable smaller 1.25kHz frequency steps
ENABLE_TX_WHEN_AM := 0 allow TX (always FM) when RX is set to AM ENABLE_TX_WHEN_AM := 0 allow TX (always FM) when RX is set to AM
ENABLE_F_CAL_MENU := 0 enable/disable the radios hidden frequency calibration menu ENABLE_F_CAL_MENU := 0 enable/disable the radios hidden frequency calibration menu
ENABLE_TX_UNLOCK := 0 '1' = allow TX everywhere EXCEPT airband (108~136) .. TX harmonic content will cause interference to other services, do so entirely at your own risk ! ENABLE_TX_UNLOCK := 0 '1' = allow TX everywhere EXCEPT airband (108~136) .. TX harmonic content will cause interference to other services, do so entirely at your own risk !
ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1 standard CTCSS tail phase shift rather than QS's own 55Hz tone method ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1 standard CTCSS tail phase shift rather than QS's own 55Hz tone method
ENABLE_BOOT_BEEPS := 0 gives user audio feedback on volume knob position at boot-up ENABLE_BOOT_BEEPS := 0 gives user audio feedback on volume knob position at boot-up
ENABLE_SHOW_CHARGE_LEVEL := 0 show the charge level when the radio is on charge ENABLE_SHOW_CHARGE_LEVEL := 0 show the charge level when the radio is on charge
ENABLE_REVERSE_BAT_SYMBOL := 1 mirror the battery symbol on the status bar (+ pole on the right) ENABLE_REVERSE_BAT_SYMBOL := 1 mirror the battery symbol on the status bar (+ pole on the right)
ENABLE_FREQ_SEARCH_TIMEOUT := 1 timeout if FREQ not found when using F+4 search function ENABLE_FREQ_SEARCH_TIMEOUT := 1 timeout if FREQ not found when using F+4 search function
ENABLE_CODE_SEARCH_TIMEOUT := 0 timeout if CTCSS/CDCSS not found when using F+* search function ENABLE_CODE_SEARCH_TIMEOUT := 0 timeout if CTCSS/CDCSS not found when using F+* search function
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_FASTER_CHANNEL_SCAN := 1 increases the channel scan speed, but the squelch is also made more twitchy ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1 open the squelch when holding down UP or DN buttons when in frequency mode
ENABLE_RSSI_BAR := 1 enable a dBm/Sn RSSI bar graph level inplace of the little antenna symbols ENABLE_FASTER_CHANNEL_SCAN := 1 increases the channel scan speed, but the squelch is also made more twitchy
ENABLE_SHOW_TX_TIMEOUT := 0 show the remainng TX time ENABLE_RSSI_BAR := 1 enable a dBm/Sn RSSI bar graph level inplace of the little antenna symbols
ENABLE_AUDIO_BAR := 1 experimental, display an audo bar level when TX'ing, includes remaining TX time (in seconds) ENABLE_SHOW_TX_TIMEOUT := 0 show the remainng TX time
ENABLE_COPY_CHAN_TO_VFO := 1 copy current channel into the other VFO. Long press Menu key ('M') ENABLE_AUDIO_BAR := 1 experimental, display an audo bar level when TX'ing, includes remaining TX time (in seconds)
#ENABLE_BAND_SCOPE := 0 not yet implemented - spectrum/pan-adapter ENABLE_COPY_CHAN_TO_VFO := 1 copy current channel into the other VFO. Long press Menu key ('M')
#ENABLE_SINGLE_VFO_CHAN := 0 not yet implemented - single VFO on display when possible #ENABLE_BAND_SCOPE := 0 not yet implemented - spectrum/pan-adapter
#ENABLE_SINGLE_VFO_CHAN := 0 not yet implemented - single VFO on display when possible
``` ```
# New/modified function keys # New/modified function keys

View File

@ -674,17 +674,38 @@ 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);
RADIO_ApplyOffset(g_rx_vfo); new_band = FREQUENCY_GetBand(frequency);
RADIO_ConfigureSquelchAndOutputPower(g_rx_vfo);
RADIO_setup_registers(true);
#ifdef ENABLE_FASTER_CHANNEL_SCAN g_rx_vfo->freq_config_rx.frequency = frequency;
g_scan_pause_delay_in_10ms = 9; // 90ms
#else if (new_band != old_band)
g_scan_pause_delay_in_10ms = scan_pause_delay_in_6_10ms; { // original slow method
#endif
RADIO_ApplyOffset(g_rx_vfo);
RADIO_ConfigureSquelchAndOutputPower(g_rx_vfo);
RADIO_setup_registers(true);
#ifdef ENABLE_FASTER_CHANNEL_SCAN
g_scan_pause_delay_in_10ms = 9; // 90ms
#else
g_scan_pause_delay_in_10ms = scan_pause_delay_in_6_10ms;
#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)
{ {
static bool monitor_was_enabled = false; #ifdef ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS
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))
{ {
if (key_held && !key_pressed && !monitor_was_enabled && g_current_function == FUNCTION_MONITOR) #ifdef ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS
{ // re-enable the squelch if (key_held && !key_pressed && !monitor_was_enabled && g_current_function == FUNCTION_MONITOR)
APP_start_listening(FUNCTION_RECEIVE, false); { // re-enable the squelch
g_monitor_enabled = false; APP_start_listening(FUNCTION_RECEIVE, false);
} g_monitor_enabled = false;
}
SETTINGS_SaveChannel(g_tx_vfo->channel_save, g_eeprom.tx_vfo, g_tx_vfo, 1); #endif
// 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,21 +801,23 @@ 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)
monitor_was_enabled = g_monitor_enabled;
if (key_held && key_pressed && !monitor_was_enabled)
{ // open the squelch if the user holds the key down
APP_start_listening(FUNCTION_MONITOR, false);
g_monitor_enabled = true;
}
#endif
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
APP_start_listening(FUNCTION_MONITOR, false);
g_monitor_enabled = true;
}
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.