diff --git a/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index 41d000d6..74d345d8 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -243,13 +243,17 @@ void RadioLibInterface::handleTransmitInterrupt() void RadioLibInterface::completeSending() { - if (sendingPacket) { + // We are careful to clear sending packet before calling printPacket because + // that can take a long time + auto p = sendingPacket; + sendingPacket = NULL; + + if (p) { txGood++; - printPacket("Completed sending", sendingPacket); + printPacket("Completed sending", p); // We are done sending that packet, release it - packetPool.release(sendingPacket); - sendingPacket = NULL; + packetPool.release(p); // DEBUG_MSG("Done with send\n"); } }