don't turn bluetooth back on every time we exit light sleep

This commit is contained in:
geeksville
2020-02-21 08:09:07 -08:00
parent 7a745c9e65
commit 132e54ecc5
7 changed files with 74 additions and 150 deletions

View File

@@ -18,6 +18,20 @@ CustomRF95::CustomRF95(MemoryPool<MeshPacket> &_pool, PointerQueue<MeshPacket> &
{
}
bool CustomRF95::canSleep()
{
return (_mode == RHModeIdle || _mode == RHModeRx) && txQueue.isEmpty(); // FIXME - also check if we have started receiving
}
bool CustomRF95::sleep()
{
// we no longer care about interrupts from this device
prepareDeepSleep();
// FIXME - leave the device state in rx mode instead
return RH_RF95::sleep();
}
bool CustomRF95::init()
{
bool ok = RH_RF95::init();