瀏覽代碼

* CAD detect fixed

Scott Powell 1 年之前
父節點
當前提交
f5f978a398
共有 2 個文件被更改,包括 8 次插入8 次删除
  1. 4 4
      src/helpers/CustomSX1262Wrapper.h
  2. 4 4
      src/helpers/CustomSX1268Wrapper.h

+ 4 - 4
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(); }

+ 4 - 4
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(); }