mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-16 00:21:35 +10:00
very important: don't allow immediate sends if we have pending ISRs
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user