mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-29 06:06:38 +00:00
LLCC68: add PREAMBLE_DETECTED to reported irq flags
This commit is contained in:
@@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
#include <RadioLib.h>
|
#include <RadioLib.h>
|
||||||
|
|
||||||
#define SX126X_IRQ_HEADER_VALID 0b0000010000 // 4 4 valid LoRa header received
|
|
||||||
#define SX126X_IRQ_PREAMBLE_DETECTED 0x04
|
|
||||||
|
|
||||||
class CustomLLCC68 : public LLCC68 {
|
class CustomLLCC68 : public LLCC68 {
|
||||||
public:
|
public:
|
||||||
CustomLLCC68(Module *mod) : LLCC68(mod) { }
|
CustomLLCC68(Module *mod) : LLCC68(mod) { }
|
||||||
@@ -78,9 +75,14 @@ class CustomLLCC68 : public LLCC68 {
|
|||||||
return true; // success
|
return true; // success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int16_t startReceive() override {
|
||||||
|
// include the PREAMBLE_DETECTED irq bit in reported flags
|
||||||
|
return LLCC68::startReceive(RADIOLIB_SX126X_RX_TIMEOUT_INF, RADIOLIB_IRQ_RX_DEFAULT_FLAGS | (1UL << RADIOLIB_IRQ_PREAMBLE_DETECTED), RADIOLIB_IRQ_RX_DEFAULT_MASK, 0);
|
||||||
|
}
|
||||||
|
|
||||||
bool isReceiving() {
|
bool isReceiving() {
|
||||||
uint16_t irq = getIrqFlags();
|
uint16_t irq = getIrqFlags();
|
||||||
bool detected = (irq & SX126X_IRQ_HEADER_VALID) || (irq & SX126X_IRQ_PREAMBLE_DETECTED);
|
bool detected = (irq & RADIOLIB_SX126X_IRQ_HEADER_VALID) || (irq & RADIOLIB_SX126X_IRQ_PREAMBLE_DETECTED);
|
||||||
return detected;
|
return detected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user