Applied bugfix to MD-UV3x0 radio driver also to GDx one

This commit is contained in:
Silvano Seva 2021-03-23 07:51:15 +01:00 committed by Niccolò Izzo
parent 75df9b7bb8
commit 32e6eb7029
1 changed files with 6 additions and 2 deletions

View File

@ -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);
}