From 68c5edd7c2693911604806369e0022657a06d59c Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 6 Aug 2023 09:31:39 +0200 Subject: [PATCH] [SX127x] Add delay before IRQ clearing (#808) --- src/modules/SX127x/SX127x.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/SX127x/SX127x.cpp b/src/modules/SX127x/SX127x.cpp index 027d512e..ca6633bb 100644 --- a/src/modules/SX127x/SX127x.cpp +++ b/src/modules/SX127x/SX127x.cpp @@ -609,6 +609,11 @@ int16_t SX127x::startTransmit(uint8_t* data, size_t len, uint8_t addr) { } int16_t SX127x::finishTransmit() { + // wait for at least 1 bit at the lowest possible bit rate before clearing IRQ flags + // not doing this and clearing RADIOLIB_SX127X_FLAG_FIFO_OVERRUN will dump the FIFO, + // which can lead to mangling of the last bit (#808) + mod->hal->delayMicroseconds(1000000/1200); + // clear interrupt flags clearIRQFlags();