fix: bug showing first channel as M256 after multiple blacklists on SL II

This commit is contained in:
Nunu 2023-12-28 14:17:07 +01:00
parent 22f47e72af
commit 3c60b37ebd

View File

@ -711,7 +711,15 @@ static void Blacklist() {
#ifdef ENABLE_SCAN_RANGES #ifdef ENABLE_SCAN_RANGES
static uint8_t ScanRangeidx() 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) static bool IsBlacklisted(uint16_t idx)