* isReceiving() now includes either preamble detect or header detect
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
#include <RadioLib.h>
|
#include <RadioLib.h>
|
||||||
|
|
||||||
#define SX126X_IRQ_HEADER_VALID 0b0000010000 // 4 4 valid LoRa header received
|
#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:
|
||||||
@@ -10,7 +11,7 @@ class CustomLLCC68 : public LLCC68 {
|
|||||||
|
|
||||||
bool isReceiving() {
|
bool isReceiving() {
|
||||||
uint16_t irq = getIrqFlags();
|
uint16_t irq = getIrqFlags();
|
||||||
bool hasPreamble = (irq & SX126X_IRQ_HEADER_VALID);
|
bool detected = (irq & SX126X_IRQ_HEADER_VALID) || (irq & SX126X_IRQ_PREAMBLE_DETECTED);
|
||||||
return hasPreamble;
|
return detected;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -11,7 +11,7 @@ class CustomLR1110 : public LR1110 {
|
|||||||
|
|
||||||
bool isReceiving() {
|
bool isReceiving() {
|
||||||
uint16_t irq = getIrqStatus();
|
uint16_t irq = getIrqStatus();
|
||||||
bool hasPreamble = ((irq & LR1110_IRQ_HEADER_VALID) && (irq & LR1110_IRQ_HAS_PREAMBLE));
|
bool detected = ((irq & LR1110_IRQ_HEADER_VALID) || (irq & LR1110_IRQ_HAS_PREAMBLE));
|
||||||
return hasPreamble;
|
return detected;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
#include <RadioLib.h>
|
#include <RadioLib.h>
|
||||||
|
|
||||||
#define SX126X_IRQ_HEADER_VALID 0b0000010000 // 4 4 valid LoRa header received
|
#define SX126X_IRQ_HEADER_VALID 0b0000010000 // 4 4 valid LoRa header received
|
||||||
|
#define SX126X_IRQ_PREAMBLE_DETECTED 0x04
|
||||||
|
|
||||||
class CustomSX1262 : public SX1262 {
|
class CustomSX1262 : public SX1262 {
|
||||||
public:
|
public:
|
||||||
@@ -10,7 +11,7 @@ class CustomSX1262 : public SX1262 {
|
|||||||
|
|
||||||
bool isReceiving() {
|
bool isReceiving() {
|
||||||
uint16_t irq = getIrqFlags();
|
uint16_t irq = getIrqFlags();
|
||||||
bool hasPreamble = (irq & SX126X_IRQ_HEADER_VALID);
|
bool detected = (irq & SX126X_IRQ_HEADER_VALID) || (irq & SX126X_IRQ_PREAMBLE_DETECTED);
|
||||||
return hasPreamble;
|
return detected;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
#include <RadioLib.h>
|
#include <RadioLib.h>
|
||||||
|
|
||||||
#define SX126X_IRQ_HEADER_VALID 0b0000010000 // 4 4 valid LoRa header received
|
#define SX126X_IRQ_HEADER_VALID 0b0000010000 // 4 4 valid LoRa header received
|
||||||
|
#define SX126X_IRQ_PREAMBLE_DETECTED 0x04
|
||||||
|
|
||||||
class CustomSX1268 : public SX1268 {
|
class CustomSX1268 : public SX1268 {
|
||||||
public:
|
public:
|
||||||
@@ -10,7 +11,7 @@ class CustomSX1268 : public SX1268 {
|
|||||||
|
|
||||||
bool isReceiving() {
|
bool isReceiving() {
|
||||||
uint16_t irq = getIrqFlags();
|
uint16_t irq = getIrqFlags();
|
||||||
bool hasPreamble = (irq & SX126X_IRQ_HEADER_VALID);
|
bool detected = (irq & SX126X_IRQ_HEADER_VALID) || (irq & SX126X_IRQ_PREAMBLE_DETECTED);
|
||||||
return hasPreamble;
|
return detected;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user