From f5f978a398738591eb15ef18535c49be23991dde Mon Sep 17 00:00:00 2001 From: Scott Powell Date: Wed, 22 Jan 2025 21:48:18 +1100 Subject: [PATCH] * CAD detect fixed --- src/helpers/CustomSX1262Wrapper.h | 8 ++++---- src/helpers/CustomSX1268Wrapper.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/helpers/CustomSX1262Wrapper.h b/src/helpers/CustomSX1262Wrapper.h index 49107e57..a7708e8b 100644 --- a/src/helpers/CustomSX1262Wrapper.h +++ b/src/helpers/CustomSX1262Wrapper.h @@ -9,12 +9,12 @@ public: bool isReceiving() override { if (((CustomSX1262 *)_radio)->isReceiving()) return true; -#if 0 // has BUG :-( commenting out for now idle(); // put sx126x into standby // do some basic CAD (blocks for ~12780 micros (on SF 10)!) - if (((CustomSX1262 *)_radio)->scanChannel() == RADIOLIB_LORA_DETECTED) return true; -#endif - return false; + bool activity = (((CustomSX1262 *)_radio)->scanChannel() == RADIOLIB_LORA_DETECTED); + idle(); + + return activity; } float getLastRSSI() const override { return ((CustomSX1262 *)_radio)->getRSSI(); } float getLastSNR() const override { return ((CustomSX1262 *)_radio)->getSNR(); } diff --git a/src/helpers/CustomSX1268Wrapper.h b/src/helpers/CustomSX1268Wrapper.h index ee07325d..4c7a4ade 100644 --- a/src/helpers/CustomSX1268Wrapper.h +++ b/src/helpers/CustomSX1268Wrapper.h @@ -9,12 +9,12 @@ public: bool isReceiving() override { if (((CustomSX1268 *)_radio)->isReceiving()) return true; -#if 0 // has BUG :-( commenting out for now idle(); // put sx126x into standby // do some basic CAD (blocks for ~12780 micros (on SF 10)!) - if (((CustomSX1268 *)_radio)->scanChannel() == RADIOLIB_LORA_DETECTED) return true; -#endif - return false; + bool activity = (((CustomSX1268 *)_radio)->scanChannel() == RADIOLIB_LORA_DETECTED); + idle(); + + return activity; } float getLastRSSI() const override { return ((CustomSX1268 *)_radio)->getRSSI(); } float getLastSNR() const override { return ((CustomSX1268 *)_radio)->getSNR(); }