[SX126x] Fixed SNR calculation for SNR les than 0
This commit is contained in:
parent
74f78ae2a2
commit
d99e050b97
1 changed files with 5 additions and 1 deletions
|
@ -1051,7 +1051,11 @@ float SX126x::getSNR() {
|
||||||
// get last packet SNR from packet status
|
// get last packet SNR from packet status
|
||||||
uint32_t packetStatus = getPacketStatus();
|
uint32_t packetStatus = getPacketStatus();
|
||||||
uint8_t snrPkt = (packetStatus >> 8) & 0xFF;
|
uint8_t snrPkt = (packetStatus >> 8) & 0xFF;
|
||||||
return(snrPkt/4.0);
|
if(snrPkt < 128) {
|
||||||
|
return(snrPkt/4.0);
|
||||||
|
} else {
|
||||||
|
return((snrPkt - 256)/4.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t SX126x::getPacketLength(bool update) {
|
size_t SX126x::getPacketLength(bool update) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue