SX1262 approximately works top-to-bottom, but need to add sleep modes

This commit is contained in:
geeksville
2020-04-30 15:43:41 -07:00
parent a2ba9d3c44
commit 62a893c760
3 changed files with 22 additions and 7 deletions

View File

@@ -100,7 +100,11 @@ bool SX1262Interface::canSendImmediately()
// 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 busy = sendingPacket != NULL || (isReceiving && lora.getPacketLength() > 0);
bool busyTx = sendingPacket != NULL;
bool busyRx = isReceiving && lora.getPacketLength() > 0;
return !busy;
if (busyTx || busyRx)
DEBUG_MSG("Can not set now, busyTx=%d, busyRx=%d\n", busyTx, busyRx);
return !busyTx && !busyRx;
}