mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2025-05-03 23:24:56 -04:00
Attach packet RSSI and SNR to packet queue entry structs. Disable ISR spinlocks on ESP32 until tested.
This commit is contained in:
parent
1de5f3c796
commit
389745ad33
7 changed files with 86 additions and 47 deletions
17
sx127x.cpp
17
sx127x.cpp
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue