From 32e6eb7029e457d5683cb2510fc6516316ca2618 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Tue, 23 Mar 2021 07:51:15 +0100 Subject: [PATCH] Applied bugfix to MD-UV3x0 radio driver also to GDx one --- platform/drivers/baseband/radio_GDx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/drivers/baseband/radio_GDx.c b/platform/drivers/baseband/radio_GDx.c index 1cea9ed9..9fa119fa 100644 --- a/platform/drivers/baseband/radio_GDx.c +++ b/platform/drivers/baseband/radio_GDx.c @@ -311,7 +311,11 @@ float radio_getRssi(const freq_t rxFreq) { (void) rxFreq; - uint16_t val = AT1846S_readRSSI(); - int8_t rssi = -151 + (val >> 8); + /* + * RSSI and SNR are packed in a 16-bit value, with RSSI being the upper + * eight bits. + */ + uint16_t val = (AT1846S_readRSSI() >> 8); + int16_t rssi = -151 + ((int16_t) val); return ((float) rssi); }