From 3c60b37ebdcc61e281f8402eb4e5462a654147ec Mon Sep 17 00:00:00 2001 From: Nunu Date: Thu, 28 Dec 2023 14:17:07 +0100 Subject: [PATCH] fix: bug showing first channel as M256 after multiple blacklists on SL II --- app/spectrum.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/spectrum.c b/app/spectrum.c index c09521f..03e0830 100644 --- a/app/spectrum.c +++ b/app/spectrum.c @@ -711,7 +711,15 @@ static void Blacklist() { #ifdef ENABLE_SCAN_RANGES static uint8_t ScanRangeidx() { - return (uint32_t)ARRAY_SIZE(rssiHistory) * 1000 / scanInfo.measurementsCount * scanInfo.i / 1000; + if(scanInfo.measurementsCount > 128) { + uint8_t i = (uint32_t)ARRAY_SIZE(rssiHistory) * 1000 / scanInfo.measurementsCount * scanInfo.i / 1000; + return i; + } + else + { + return 0; + } + } static bool IsBlacklisted(uint16_t idx)