From 7730bd762a9bd4bb7b54d93d3246a8ecdbf4ccfa Mon Sep 17 00:00:00 2001 From: geeksville Date: Fri, 17 Apr 2020 13:18:33 -0700 Subject: [PATCH] be less chatty about sleep --- src/rf95/CustomRF95.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rf95/CustomRF95.cpp b/src/rf95/CustomRF95.cpp index 62900c355..5dc5d0bb9 100644 --- a/src/rf95/CustomRF95.cpp +++ b/src/rf95/CustomRF95.cpp @@ -17,8 +17,12 @@ bool CustomRF95::canSleep() { // We allow initializing mode, because sometimes while testing we don't ever call init() to turn on the hardware bool isRx = isReceiving(); - DEBUG_MSG("canSleep, mode=%d, isRx=%d, txEmpty=%d, txGood=%d\n", _mode, isRx, txQueue.isEmpty(), _txGood); - return (_mode == RHModeInitialising || _mode == RHModeIdle || _mode == RHModeRx) && !isRx && txQueue.isEmpty(); + + bool res = (_mode == RHModeInitialising || _mode == RHModeIdle || _mode == RHModeRx) && !isRx && txQueue.isEmpty(); + if (!res) // only print debug messages if we are vetoing sleep + DEBUG_MSG("canSleep, mode=%d, isRx=%d, txEmpty=%d, txGood=%d\n", _mode, isRx, txQueue.isEmpty(), _txGood); + + return res; } bool CustomRF95::sleep()