From 022f3d233aa4cfd5822b14e5823188cb2c84a78e Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sun, 12 Dec 2021 22:12:08 +0100 Subject: [PATCH] fix rssi_iir_update() and rssi_get_avg() channel checks in bluetooth_rxtx/ubertooth_rssi.c --- firmware/bluetooth_rxtx/ubertooth_rssi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/bluetooth_rxtx/ubertooth_rssi.c b/firmware/bluetooth_rxtx/ubertooth_rssi.c index d78aaa12..8ab89b31 100644 --- a/firmware/bluetooth_rxtx/ubertooth_rssi.c +++ b/firmware/bluetooth_rxtx/ubertooth_rssi.c @@ -58,7 +58,7 @@ void rssi_iir_update(uint16_t channel) /* Use array to track 79 Bluetooth channels, or just first slot * of array if the frequency is not a valid Bluetooth channel. */ - if ( channel < 2402 || channel < 2480 ) + if ( channel < 2402 || channel > 2480 ) channel = 2402; int i = channel - 2402; @@ -77,7 +77,7 @@ int8_t rssi_get_avg(uint16_t channel) { /* Use array to track 79 Bluetooth channels, or just first slot * of array if the frequency is not a valid Bluetooth channel. */ - if ( channel < 2402 || channel < 2480 ) + if ( channel < 2402 || channel > 2480 ) channel = 2402; return (rssi_iir[channel-2402] + 128) / 256;