0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-27 22:01:26 +03:00

squelch closing when '0' fix

This commit is contained in:
OneOfEleven 2024-01-08 13:39:43 +00:00
parent dbf1468757
commit 8d16e7d319
8 changed files with 100 additions and 48 deletions

View File

@ -87,7 +87,7 @@ ENABLE_SCAN_RANGES := 1
# AM Fix 800 B
ENABLE_AM_FIX := 1
ENABLE_AM_FIX_SHOW_DATA := 0
ENABLE_SQUELCH_MORE_SENSITIVE := 0
#ENABLE_SQUELCH_MORE_SENSITIVE := 0
ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1
ENABLE_FASTER_CHANNEL_SCAN := 1
ENABLE_COPY_CHAN_TO_VFO_TO_CHAN := 1
@ -473,9 +473,9 @@ endif
ifeq ($(ENABLE_AM_FIX_TEST1),1)
CFLAGS += -DENABLE_AM_FIX_TEST1
endif
ifeq ($(ENABLE_SQUELCH_MORE_SENSITIVE),1)
CFLAGS += -DENABLE_SQUELCH_MORE_SENSITIVE
endif
#ifeq ($(ENABLE_SQUELCH_MORE_SENSITIVE),1)
# CFLAGS += -DENABLE_SQUELCH_MORE_SENSITIVE
#endif
ifeq ($(ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS),1)
CFLAGS += -DENABLE_SQ_OPEN_WITH_UP_DN_BUTTS
endif

View File

@ -957,6 +957,7 @@ void APP_process_radio_interrupts(void)
// { // VOX
// }
#if 0
if (reg_c & (1u << 1))
{ // squelch is open
if (!g_squelch_open)
@ -988,6 +989,7 @@ void APP_process_radio_interrupts(void)
g_update_display = true;
}
}
#endif
// #ifdef ENABLE_CTCSS_TAIL_PHASE_SHIFT
// if (((reg_c >> 12) & 3u) > 0)
@ -1149,7 +1151,8 @@ void APP_process_radio_interrupts(void)
#endif
}
#endif
/*
#if 1
if (int_bits & BK4819_REG_02_SQUELCH_CLOSED)
{
g_squelch_open = false;
@ -1185,7 +1188,8 @@ void APP_process_radio_interrupts(void)
g_update_display = true;
}
*/
#endif
#ifdef ENABLE_MDC1200
MDC1200_process_rx(int_bits);
#endif

View File

@ -98,7 +98,7 @@ void BK4819_Init(void)
// squelch mode
// BK4819_write_reg(0x77, 0x88EF); // rssi + noise + glitch .. RT-890
BK4819_write_reg(0x77, 0xA8EF); // rssi + noise + glitch .. default
// BK4819_write_reg(0x77, 0xA8EF); // rssi + noise + glitch .. default
// BK4819_write_reg(0x77, 0xAAEF); // rssi + glitch
// BK4819_write_reg(0x77, 0xCCEF); // rssi + noise
// BK4819_write_reg(0x77, 0xFFEF); // rssi

Binary file not shown.

Binary file not shown.

15
radio.c
View File

@ -438,10 +438,20 @@ void RADIO_configure_channel(const unsigned int VFO, const unsigned int configur
void RADIO_ConfigureSquelch(vfo_info_t *p_vfo)
{
const unsigned int squelch_level = (p_vfo->channel.squelch_level > 0) ? p_vfo->channel.squelch_level : g_eeprom.config.setting.squelch_level;
const unsigned int squelch_level = (p_vfo->channel.squelch_level > 0 && p_vfo->channel.squelch_level < 10) ? p_vfo->channel.squelch_level : g_eeprom.config.setting.squelch_level;
// note that 'noise' and 'glitch' values are inverted compared to 'rssi' values
// peters readings, all on 156.550
//
// no antenna no signal r 53 g 83 n 73
// signal generator -100dBm signal r 114 g 0 n 17
// signal generator -110dBm signal r 95 g 0 n 32
// signal generator -120dBm signal r 75 g 0 n 34
//
// ext antenna no signal r 93~133 g 150 n 78
// ext antenna strong signal r 123~160 g 0 n 16~18
if (squelch_level == 0)
{ // squelch == 0 (off)
p_vfo->squelch_open_rssi_thresh = 0; // 0 ~ 255
@ -540,7 +550,7 @@ void RADIO_ConfigureSquelch(vfo_info_t *p_vfo)
#else
// a little more sensitive
/*
rssi_open = (rssi_open * 3) / 4;
noise_open = (noise_open * 4) / 3;
glitch_open = (glitch_open * 4) / 3;
@ -548,6 +558,7 @@ void RADIO_ConfigureSquelch(vfo_info_t *p_vfo)
rssi_close = (rssi_close * 3) / 4;
noise_close = (noise_close * 4) / 3;
glitch_close = (glitch_close * 4) / 3;
*/
#endif
// *********

View File

@ -174,7 +174,12 @@ bool UI_DisplayRSSIBar(const int rssi, const unsigned int glitch, const unsigned
{
#ifdef SHOW_RX_TEST_VALUES
#ifdef ENABLE_SINGLE_VFO_CHAN
const unsigned int line = (single_vfo >= 0 && !pan_enabled) ? 6 : 3;
#else
const unsigned int line = 3;
#endif
char str[22];
#ifdef ENABLE_KEYLOCK
@ -182,7 +187,11 @@ bool UI_DisplayRSSIBar(const int rssi, const unsigned int glitch, const unsigned
return false; // display is in use
#endif
if (g_current_function == FUNCTION_TRANSMIT || g_current_display_screen != DISPLAY_MAIN || g_dtmf_call_state != DTMF_CALL_STATE_NONE)
if (g_current_function == FUNCTION_TRANSMIT ||
#ifdef ENABLE_DTMF_CALLING
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
#endif
g_current_display_screen != DISPLAY_MAIN)
return false; // display is in use
if (now)
@ -279,12 +288,15 @@ void UI_update_rssi(const int rssi, const unsigned int glitch, const unsigned in
if (g_center_line == CENTER_LINE_RSSI)
{ // large RSSI dBm, S-point, bar level
#ifdef SHOW_RX_TEST_VALUES
if (g_current_function != FUNCTION_TRANSMIT)
UI_DisplayRSSIBar(rssi, glitch, noise, true);
#else
const int rssi_level = (g_tx_vfo->channel_attributes.band < 3) ? rssi + rssi_offset_band_123 : rssi + rssi_offset_band_4567;
//if (g_current_function == FUNCTION_RECEIVE && g_squelch_open)
if (g_current_function == FUNCTION_RECEIVE)
UI_DisplayRSSIBar(rssi_level, glitch, noise, true);
#endif
}
#ifdef ENABLE_SINGLE_VFO_CHAN
@ -585,6 +597,14 @@ void UI_DisplayCenterLine(void)
#endif
// show the RX RSSI dBm, S-point and signal strength bar graph
#ifdef SHOW_RX_TEST_VALUES
if (g_eeprom.config.setting.enable_rssi_bar)
{
g_center_line = CENTER_LINE_RSSI;
UI_DisplayRSSIBar(g_current_rssi[g_rx_vfo_num], g_current_glitch[g_rx_vfo_num], g_current_noise[g_rx_vfo_num], false);
}
else
#else
if (rx && g_eeprom.config.setting.enable_rssi_bar)
{
const int rssi_level = (g_tx_vfo->channel_attributes.band < 3) ? g_current_rssi[g_rx_vfo_num] + rssi_offset_band_123 : g_current_rssi[g_rx_vfo_num] + rssi_offset_band_4567;
@ -592,6 +612,7 @@ void UI_DisplayCenterLine(void)
UI_DisplayRSSIBar(rssi_level, g_current_glitch[g_rx_vfo_num], g_current_noise[g_rx_vfo_num], false);
}
else
#endif
if (rx || g_current_function == FUNCTION_FOREGROUND || g_current_function == FUNCTION_POWER_SAVE)
{
@ -773,7 +794,7 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
strcpy(str, "RX");
else
{
const unsigned int squelch_level = (p_vfo->channel.squelch_level > 0) ? p_vfo->channel.squelch_level : g_eeprom.config.setting.squelch_level;
const unsigned int squelch_level = (p_vfo->channel.squelch_level > 0 && p_vfo->channel.squelch_level < 10) ? p_vfo->channel.squelch_level : g_eeprom.config.setting.squelch_level;
sprintf(str, "Q%u", squelch_level);
#ifdef ENABLE_SMALL_BOLD
bold = false;
@ -869,7 +890,7 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
#ifdef ENABLE_SHOW_FREQ_IN_CHAN
UI_PrintString(str, x, 0, y, 8);
if (IS_FREQ_CHANNEL(scrn_chan) && freq_in_channel <= USER_CHANNEL_LAST)
if (freq_in_channel <= USER_CHANNEL_LAST)
{
SETTINGS_fetch_channel_name(str, freq_in_channel);
if (str[0] == 0)
@ -881,7 +902,23 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
#else
UI_PrintString(str, x, 0, y + 1, 8);
#endif
/*
#ifdef SHOW_RX_TEST_VALUES
{
const uint8_t ro = (BK4819_read_reg(0x78) >> 8) & 0xff;
const uint8_t rc = BK4819_read_reg(0x78) & 0xff;
const uint8_t no = BK4819_read_reg(0x4F) & 0x7f;
const uint8_t nc = (BK4819_read_reg(0x4F) >> 8) & 0x7f;
const uint8_t go = BK4819_read_reg(0x4E) & 0xff;
const uint8_t gc = BK4819_read_reg(0x4D) & 0xff;
sprintf(str, "%02X %02X %02X %02X %02X %02X", ro, rc, no, nc, go, gc);
UI_PrintStringSmall(str, 0, 0, y + 3);
}
#endif
*/
#endif
}