1
0
mirror of https://github.com/sandeepmistry/arduino-LoRa.git synced 2025-04-19 13:02:14 +03:00

Don't clear all IRQ flags, just the ones read

This commit is contained in:
Sandeep Mistry 2016-09-25 08:39:08 -04:00
parent 7f75498dfc
commit caed5b1c4c

View File

@ -119,7 +119,7 @@ int LoRaClass::endPacket()
while((readRegister(REG_IRQ_FLAGS) & IRQ_TX_DONE_MASK) == 0);
// clear IRQ's
writeRegister(REG_IRQ_FLAGS, 0xff);
writeRegister(REG_IRQ_FLAGS, IRQ_TX_DONE_MASK);
return 1;
}
@ -130,7 +130,7 @@ int LoRaClass::parsePacket()
int irqFlags = readRegister(REG_IRQ_FLAGS);
// clear IRQ's
writeRegister(REG_IRQ_FLAGS, 0xff);
writeRegister(REG_IRQ_FLAGS, irqFlags);
if (irqFlags & IRQ_RX_DONE_MASK) {
// received a packet