0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-08-02 17:16:32 +03:00
This commit is contained in:
OneOfEleven
2023-11-11 13:09:24 +00:00
parent 852998f082
commit 56aaf876ef
12 changed files with 118 additions and 98 deletions

View File

@@ -265,8 +265,9 @@ void ACTION_Scan(bool bRestart)
#ifdef ENABLE_SCAN_RANGES
if (IS_FREQ_CHANNEL(g_tx_vfo->channel_save) && g_eeprom.config.setting.scan_ranges_enable)
{
const uint32_t freq = g_tx_vfo->freq_config_rx.frequency;
uint32_t freq = g_tx_vfo->freq_config_rx.frequency;
FREQUENCY_scan_range(freq, &g_scan_initial_lower, &g_scan_initial_upper, &g_scan_initial_step_size);
// freq = FREQUENCY_floor_to_step(freq, g_scan_initial_step_size, g_scan_initial_lower, g_scan_initial_upper); }
}
#endif

View File

@@ -180,6 +180,9 @@ static void APP_process_new_receive(void)
{
bool flag;
if (!g_squelch_open)
BK4819_set_AFC(0);
if (!g_squelch_open && !g_monitor_enabled)
{ // squelch is closed
@@ -190,11 +193,24 @@ static void APP_process_new_receive(void)
{
FUNCTION_Select(FUNCTION_FOREGROUND);
g_update_display = true;
// g_update_status = true;
}
return;
}
switch (g_rx_vfo->channel.mod_mode)
{
case MOD_MODE_FM:
case MOD_MODE_AM:
BK4819_set_AFC(2);
break;
default:
case MOD_MODE_DSB:
BK4819_set_AFC(0);
break;
}
flag = (g_scan_state_dir == SCAN_STATE_DIR_OFF && g_current_code_type == CODE_TYPE_NONE);
#ifdef ENABLE_NOAA
@@ -220,7 +236,7 @@ static void APP_process_new_receive(void)
return;
if (g_scan_state_dir == SCAN_STATE_DIR_OFF && g_css_scan_mode == CSS_SCAN_MODE_OFF)
{ // not code scanning
{ // not scanning
#ifdef ENABLE_KILL_REVIVE
if (g_rx_vfo->channel.dtmf_decoding_enable || g_eeprom.config.setting.radio_disabled)
@@ -240,7 +256,6 @@ static void APP_process_new_receive(void)
g_update_status = true;
g_update_display = true;
return;
}
}
@@ -264,6 +279,9 @@ static void APP_process_rx(void)
// APP_update_rssi(g_rx_vfo_num);
g_update_rssi = true;
// if (!g_squelch_open)
// BK4819_set_AFC(0);
if (g_flag_tail_tone_elimination_complete)
{
Mode = END_OF_RX_MODE_END;
@@ -476,6 +494,18 @@ bool APP_start_listening(void)
// clear the other vfo's rssi level (to hide the antenna symbol)
g_vfo_rssi_bar_level[(chan + 1) & 1u] = 0;
switch (g_rx_vfo->channel.mod_mode)
{
case MOD_MODE_FM:
case MOD_MODE_AM:
BK4819_set_AFC(2);
break;
default:
case MOD_MODE_DSB:
BK4819_set_AFC(0);
break;
}
if (g_scan_state_dir != SCAN_STATE_DIR_OFF)
{ // we're RF scanning
@@ -674,7 +704,10 @@ static void APP_next_freq(void)
// round
#ifdef ENABLE_SCAN_RANGES
if (g_eeprom.config.setting.scan_ranges_enable)
freq = g_scan_initial_lower + ((((freq - g_scan_initial_lower) + (g_scan_initial_step_size / 2)) / g_scan_initial_step_size) * g_scan_initial_step_size);
//freq = g_scan_initial_lower + ((((freq - g_scan_initial_lower) + (g_scan_initial_step_size / 2)) / g_scan_initial_step_size) * g_scan_initial_step_size);
freq = FREQUENCY_floor_to_step(freq, g_scan_initial_step_size, g_scan_initial_lower, g_scan_initial_upper);
#else
//freq = FREQUENCY_floor_to_step(freq, g_scan_initial_step_size, g_scan_initial_lower, g_scan_initial_upper);
#endif
#ifdef ENABLE_SCAN_IGNORE_LIST

View File

@@ -1016,11 +1016,11 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t directio
if (IS_FREQ_CHANNEL(Channel))
{ // frequency mode
uint32_t freq = g_tx_vfo->freq_config_rx.frequency;
uint32_t freq = g_tx_vfo->freq_config_rx.frequency;
const frequency_band_t band = FREQUENCY_GetBand(freq);
if (key_pressed && !key_held)
{ // just pressed
const frequency_band_t band = FREQUENCY_GetBand(freq);
g_scan_initial_upper = FREQ_BAND_TABLE[band].upper;
g_scan_initial_lower = FREQ_BAND_TABLE[band].lower;
@@ -1028,8 +1028,14 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t directio
#ifdef ENABLE_SCAN_RANGES
//if (g_eeprom.config.setting.scan_ranges_enable)
//{
// FREQUENCY_scan_range(freq, &g_scan_initial_lower, &g_scan_initial_upper, &g_scan_initial_step_size);
// freq = FREQUENCY_floor_to_step(freq, g_scan_initial_step_size, g_scan_initial_lower, g_scan_initial_upper);
//}
#endif
// if (band == BAND2_108MHz)
// freq = FREQUENCY_floor_to_step(freq, g_scan_initial_step_size, g_scan_initial_lower, g_scan_initial_upper);
}
freq += g_scan_initial_step_size * direction;
@@ -1046,9 +1052,13 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t directio
// round
#ifdef ENABLE_SCAN_RANGES
//if (key_held)
// freq = g_scan_initial_lower + ((((freq - g_scan_initial_lower) + (g_scan_initial_step_size / 2)) / g_scan_initial_step_size) * g_scan_initial_step_size);
// //freq = g_scan_initial_lower + ((((freq - g_scan_initial_lower) + (g_scan_initial_step_size / 2)) / g_scan_initial_step_size) * g_scan_initial_step_size);
// freq = FREQUENCY_floor_to_step(freq, g_scan_initial_step_size, g_scan_initial_lower, g_scan_initial_upper);
#endif
if (band == BAND2_108MHz)
freq = FREQUENCY_floor_to_step(freq, g_scan_initial_step_size, g_scan_initial_lower, g_scan_initial_upper);
if (FREQUENCY_rx_freq_check(freq) < 0)
{ // frequency not allowed
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;

View File

@@ -1060,7 +1060,8 @@ void MENU_ShowCurrentSetting(void)
case MENU_AUTO_BACKLITE:
g_sub_menu_selection = g_eeprom.config.setting.backlight_time;
BACKLIGHT_turn_on(0);
// BACKLIGHT_turn_on(0);
BACKLIGHT_turn_on(5);
break;
case MENU_AUTO_BACKLITE_ON_TX_RX: