implement most of sleep handling for the new radio stack

This commit is contained in:
geeksville
2020-04-30 15:50:07 -07:00
parent 62a893c760
commit d7d8188093
5 changed files with 31 additions and 1 deletions

View File

@@ -89,6 +89,15 @@ ErrorCode RadioLibInterface::send(MeshPacket *p)
}
}
bool RadioLibInterface::canSleep()
{
bool res = txQueue.isEmpty();
if (!res) // only print debug messages if we are vetoing sleep
DEBUG_MSG("radio wait to sleep, txEmpty=%d\n", txQueue.isEmpty());
return res;
}
void RadioLibInterface::loop()
{
PendingISR wasPending = pending; // atomic read