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

1.2-legacy
Kevin Hester 2020-10-29 15:27:05 +08:00
rodzic b9a1cae72d
commit 04942a3570
1 zmienionych plików z 8 dodań i 4 usunięć

Wyświetl plik

@ -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");
}
}