Fix RSSI miscalculation and TX power not being set correctly

This commit is contained in:
jacob.eva
2024-01-29 20:36:14 +00:00
parent 98ee2f6d32
commit c21d8dcb2b
3 changed files with 4 additions and 4 deletions

View File

@@ -775,7 +775,7 @@ int ISR_VECT LoRaClass::packetRssi() {
// may need more calculations here
uint8_t buf[3] = {0};
executeOpcodeRead(OP_PACKET_STATUS, buf, 3);
int pkt_rssi = -(int(buf[2])) / 2;
int pkt_rssi = -buf[0] / 2;
return pkt_rssi;
#endif
}
@@ -796,7 +796,7 @@ float ISR_VECT LoRaClass::packetSnr() {
#elif MODEM == SX1262
uint8_t buf[3] = {0};
executeOpcodeRead(OP_PACKET_STATUS, buf, 3);
return float(buf[1]) / 4.0;
return float(buf[1]) * 0.25;
#endif
}