fix #505 - device can reboot due to race condition in sending

This commit is contained in:
Kevin Hester 2020-10-29 15:27:05 +08:00
parent b9a1cae72d
commit 04942a3570

View File

@ -243,13 +243,17 @@ void RadioLibInterface::handleTransmitInterrupt()
void RadioLibInterface::completeSending() 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++; txGood++;
printPacket("Completed sending", sendingPacket); printPacket("Completed sending", p);
// We are done sending that packet, release it // We are done sending that packet, release it
packetPool.release(sendingPacket); packetPool.release(p);
sendingPacket = NULL;
// DEBUG_MSG("Done with send\n"); // DEBUG_MSG("Done with send\n");
} }
} }