[SX126x][SX128x][LR11x0] Don't report CRC mismatch if valid header received (#1203)
* Enable `HEADER_VALID` IRQ flags by default for receiving * [SX126x] Don't report CRC mismatch if valid header received * [SX128x] Don't report CRC mismatch if valid header received * [LR11x0] Don't report CRC mismatch if valid header received
This commit is contained in:
parent
bc801c7004
commit
eda4ec22ae
4 changed files with 7 additions and 4 deletions
src
|
@ -530,7 +530,8 @@ int16_t LR11x0::readData(uint8_t* data, size_t len) {
|
|||
// check integrity CRC
|
||||
uint32_t irq = getIrqStatus();
|
||||
int16_t crcState = RADIOLIB_ERR_NONE;
|
||||
if((irq & RADIOLIB_LR11X0_IRQ_CRC_ERR) || (irq & RADIOLIB_LR11X0_IRQ_HEADER_ERR)) {
|
||||
// Report CRC mismatch when there's a payload CRC error, or a header error and no valid header (to avoid false alarm from previous packet)
|
||||
if((irq & RADIOLIB_LR11X0_IRQ_CRC_ERR) || ((irq & RADIOLIB_LR11X0_IRQ_HEADER_ERR) && !(irq & RADIOLIB_LR11X0_IRQ_SYNC_WORD_HEADER_VALID))) {
|
||||
crcState = RADIOLIB_ERR_CRC_MISMATCH;
|
||||
}
|
||||
|
||||
|
|
|
@ -726,7 +726,8 @@ int16_t SX126x::readData(uint8_t* data, size_t len) {
|
|||
// check integrity CRC
|
||||
uint16_t irq = getIrqFlags();
|
||||
int16_t crcState = RADIOLIB_ERR_NONE;
|
||||
if((irq & RADIOLIB_SX126X_IRQ_CRC_ERR) || (irq & RADIOLIB_SX126X_IRQ_HEADER_ERR)) {
|
||||
// Report CRC mismatch when there's a payload CRC error, or a header error and no valid header (to avoid false alarm from previous packet)
|
||||
if((irq & RADIOLIB_SX126X_IRQ_CRC_ERR) || ((irq & RADIOLIB_SX126X_IRQ_HEADER_ERR) && !(irq & RADIOLIB_SX126X_IRQ_HEADER_VALID))) {
|
||||
crcState = RADIOLIB_ERR_CRC_MISMATCH;
|
||||
}
|
||||
|
||||
|
|
|
@ -638,7 +638,8 @@ int16_t SX128x::readData(uint8_t* data, size_t len) {
|
|||
// check integrity CRC
|
||||
uint16_t irq = getIrqStatus();
|
||||
int16_t crcState = RADIOLIB_ERR_NONE;
|
||||
if((irq & RADIOLIB_SX128X_IRQ_CRC_ERROR) || (irq & RADIOLIB_SX128X_IRQ_HEADER_ERROR)) {
|
||||
// Report CRC mismatch when there's a payload CRC error, or a header error and no valid header (to avoid false alarm from previous packet)
|
||||
if((irq & RADIOLIB_SX128X_IRQ_CRC_ERROR) || ((irq & RADIOLIB_SX128X_IRQ_HEADER_ERROR) && !(irq & RADIOLIB_SX128X_IRQ_HEADER_VALID))) {
|
||||
crcState = RADIOLIB_ERR_CRC_MISMATCH;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ enum RadioLibIrqType_t {
|
|||
};
|
||||
|
||||
// some commonly used default values - defined here to ensure all modules have the same default behavior
|
||||
#define RADIOLIB_IRQ_RX_DEFAULT_FLAGS ((1UL << RADIOLIB_IRQ_RX_DONE) | (1UL << RADIOLIB_IRQ_TIMEOUT) | (1UL << RADIOLIB_IRQ_CRC_ERR) | (1UL << RADIOLIB_IRQ_HEADER_ERR))
|
||||
#define RADIOLIB_IRQ_RX_DEFAULT_FLAGS ((1UL << RADIOLIB_IRQ_RX_DONE) | (1UL << RADIOLIB_IRQ_TIMEOUT) | (1UL << RADIOLIB_IRQ_CRC_ERR) | (1UL << RADIOLIB_IRQ_HEADER_VALID) | (1UL << RADIOLIB_IRQ_HEADER_ERR))
|
||||
#define RADIOLIB_IRQ_RX_DEFAULT_MASK ((1UL << RADIOLIB_IRQ_RX_DONE))
|
||||
#define RADIOLIB_IRQ_CAD_DEFAULT_FLAGS ((1UL << RADIOLIB_IRQ_CAD_DETECTED) | (1UL << RADIOLIB_IRQ_CAD_DONE))
|
||||
#define RADIOLIB_IRQ_CAD_DEFAULT_MASK ((1UL << RADIOLIB_IRQ_CAD_DETECTED) | (1UL << RADIOLIB_IRQ_CAD_DONE))
|
||||
|
|
Loading…
Add table
Reference in a new issue