Fixed issue with RSSI calculation on MD-UV3x0, leading to an output value of +105dBm when AT1846S register read 0x00

replace/3facdf20ee06a52eebefec10b11df0115794ffb2
Silvano Seva 2021-03-22 18:01:37 +01:00
rodzic fb295a7aa0
commit a20f907330
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

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