very important: don't allow immediate sends if we have pending ISRs

This commit is contained in:
geeksville
2020-05-01 08:32:16 -07:00
parent 82c1752d85
commit 31eb2f5337
6 changed files with 30 additions and 28 deletions
+2 -11
View File
@@ -106,18 +106,9 @@ void RF95Interface::startReceive()
}
/** Could we send right now (i.e. either not actively receving or transmitting)? */
bool RF95Interface::canSendImmediately()
bool RF95Interface::isActivelyReceiving()
{
// We wait _if_ we are partially though receiving a packet (rather than just merely waiting for one).
// To do otherwise would be doubly bad because not only would we drop the packet that was on the way in,
// we almost certainly guarantee no one outside will like the packet we are sending.
bool busyTx = sendingPacket != NULL;
bool busyRx = isReceiving && lora->isReceiving();
if (busyTx || busyRx)
DEBUG_MSG("Can not set now, busyTx=%d, busyRx=%d\n", busyTx, busyRx);
return !busyTx && !busyRx;
return lora->isReceiving();
}
bool RF95Interface::sleep()