From 55e7d4b4e61c19871e9176431f88056ab41e89d6 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Sun, 16 Sep 2018 15:30:58 +0200 Subject: [PATCH] lmic radio.c snr/rssi fix --- lib/arduino-lmic-1.5.0-arduino-2-tweaked/src/lmic/radio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/arduino-lmic-1.5.0-arduino-2-tweaked/src/lmic/radio.c b/lib/arduino-lmic-1.5.0-arduino-2-tweaked/src/lmic/radio.c index 0fffaa4f..6c570545 100644 --- a/lib/arduino-lmic-1.5.0-arduino-2-tweaked/src/lmic/radio.c +++ b/lib/arduino-lmic-1.5.0-arduino-2-tweaked/src/lmic/radio.c @@ -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)