Attach packet RSSI and SNR to packet queue entry structs. Disable ISR spinlocks on ESP32 until tested.

This commit is contained in:
Mark Qvist 2024-10-11 16:29:17 +02:00
parent 1de5f3c796
commit 389745ad33
7 changed files with 86 additions and 47 deletions

View file

@ -230,6 +230,23 @@ uint8_t sx127x::packetRssiRaw() {
return pkt_rssi_value;
}
int ISR_VECT sx127x::packetRssi(uint8_t pkt_snr_raw) {
int pkt_rssi = (int)readRegister(REG_PKT_RSSI_VALUE_7X) - RSSI_OFFSET;
int pkt_snr = ((int8_t)pkt_snr_raw)*0.25;
if (_frequency < 820E6) pkt_rssi -= 7;
if (pkt_snr < 0) {
pkt_rssi += pkt_snr;
} else {
// Slope correction is (16/15)*pkt_rssi,
// this estimation looses one floating point
// operation, and should be precise enough.
pkt_rssi = (int)(1.066 * pkt_rssi);
}
return pkt_rssi;
}
int ISR_VECT sx127x::packetRssi() {
int pkt_rssi = (int)readRegister(REG_PKT_RSSI_VALUE_7X) - RSSI_OFFSET;
int pkt_snr = packetSnr();