From ec4ea28325bea912c4254146b1846ffcb31005d7 Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Sun, 3 May 2026 16:49:47 +0200 Subject: [PATCH] Reset fast scan RSSI floor on AM/FM changes --- App/app/chFrScanner.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/App/app/chFrScanner.c b/App/app/chFrScanner.c index 3c755fc1..e03b28d1 100644 --- a/App/app/chFrScanner.c +++ b/App/app/chFrScanner.c @@ -98,6 +98,11 @@ static void ScanFastResetState(void) scanFastLastFullTuneCandidate = false; } +static void ScanFastResetNoiseFloor(void) +{ + scanFastNoiseFloor = SCAN_FAST_RSSI_MAX; +} + static uint16_t ScanFastReadRssi(void) { uint8_t guard = SCAN_FAST_GLITCH_GUARD_MAX; @@ -180,6 +185,15 @@ static void ScanFastApplyChannelShape(ModulationMode_t modulation) BK4819_SetFilterBandwidth(BK4819_FILTER_BW_WIDE, false); #endif } + + if (modulationChanged) + { + // AM and FM use different demod/AGC profiles, so their RSSI + // baselines are not directly comparable. Relearn the floor after + // crossing that boundary instead of treating the next FM block as + // a wall of candidates. + ScanFastResetNoiseFloor(); + } } #endif