From bc2026282581f05c52e1aec5fd19c2d1de982a45 Mon Sep 17 00:00:00 2001 From: jyesmith Date: Thu, 13 Sep 2018 18:35:22 +1000 Subject: [PATCH] fix(bandscan): changes bandscan to use max rssi and not mean --- src/rx5808-pro-diversity/state_bandscan.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rx5808-pro-diversity/state_bandscan.cpp b/src/rx5808-pro-diversity/state_bandscan.cpp index 93ca6d5b..bef5c34f 100644 --- a/src/rx5808-pro-diversity/state_bandscan.cpp +++ b/src/rx5808-pro-diversity/state_bandscan.cpp @@ -30,10 +30,10 @@ void StateMachine::BandScanStateHandler::onUpdate() { return; if (!EepromSettings.quadversity) { - rssiData[orderedChanelIndex] = (Receiver::rssiA + Receiver::rssiB) / 2; + rssiData[orderedChanelIndex] = max(Receiver::rssiA, Receiver::rssiB); } if (EepromSettings.quadversity) { - rssiData[orderedChanelIndex] = ((Receiver::rssiA + Receiver::rssiB)/2 + (Receiver::rssiC + Receiver::rssiD)/2) / 2; + rssiData[orderedChanelIndex] = max(Receiver::rssiA, max(Receiver::rssiB, max(Receiver::rssiC, Receiver::rssiD))); } orderedChanelIndex = (orderedChanelIndex + 1) % (CHANNELS_SIZE);