lmic radio.c snr/rssi fix

This commit is contained in:
Klaus K Wilting 2018-09-16 15:30:58 +02:00
parent fb7c32e5c8
commit 55e7d4b4e6

View File

@ -791,7 +791,7 @@ void radio_irq_handler (u1_t dio) {
readBuf(RegFifo, LMIC.frame, LMIC.dataLen);
// read rx quality parameters
//LMIC.snr = readReg(LORARegPktSnrValue); // SNR [dB] * 4
LMIC.snr = readReg(LORARegPktSnrValue) / 4;
LMIC.snr = ((s1_t)readReg(LORARegPktSnrValue)) / 4;
//LMIC.rssi = readReg(LORARegPktRssiValue) - 125 + 64; // RSSI [dBm] (-196...+63)
LMIC.rssi = readReg(LORARegPktRssiValue) - 157; // RFI_HF for 868 and 915MHZ band
if (LMIC.snr < 0)