rx: fix squelch level tracking

Thanks to rudi_s for reporting this.
This commit is contained in:
Thomas Kolb 2024-04-26 21:50:07 +02:00
parent d3b0ac1e0a
commit e22b9ed4c5

View file

@ -163,7 +163,9 @@ static enum squelch_state_t update_and_check_squelch(layer1_rx_t *rx, unsigned i
if(level < rx->noise_floor_level) {
rx->noise_floor_level = level;
} else {
level += 1e-4f; // slowly increase the measured noise floor level to compensate for drift
// Slowly increase the measured noise floor level to compensate for drift.
// Adjustment value is in dB.
rx->noise_floor_level += 1e-4f;
}
agc_crcf_squelch_set_threshold(rx->agc, rx->noise_floor_level + 10.0f); // in dB
}