[SX126x] Fixed implicit timeout workaround applied in explicit mode
This commit is contained in:
parent
9c7ff5632b
commit
235fdb1637
1 changed files with 10 additions and 3 deletions
|
@ -286,9 +286,11 @@ int16_t SX126x::receive(uint8_t* data, size_t len) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// timeout fix is recommended after any reception with active timeout
|
// fix timeout in implicit LoRa mode
|
||||||
state = fixImplicitTimeout();
|
if(((_headerType == SX126X_LORA_HEADER_IMPLICIT) && (getPacketType() == SX126X_PACKET_TYPE_LORA))) {
|
||||||
RADIOLIB_ASSERT(state);
|
state = fixImplicitTimeout();
|
||||||
|
RADIOLIB_ASSERT(state);
|
||||||
|
}
|
||||||
|
|
||||||
// read the received data
|
// read the received data
|
||||||
return(readData(data, len));
|
return(readData(data, len));
|
||||||
|
@ -1402,6 +1404,11 @@ int16_t SX126x::fixImplicitTimeout() {
|
||||||
// fixes timeout in implicit header mode
|
// fixes timeout in implicit header mode
|
||||||
// see SX1262/SX1268 datasheet, chapter 15 Known Limitations, section 15.3 for details
|
// see SX1262/SX1268 datasheet, chapter 15 Known Limitations, section 15.3 for details
|
||||||
|
|
||||||
|
//check if we're in implicit LoRa mode
|
||||||
|
if(!((_headerType == SX126X_LORA_HEADER_IMPLICIT) && (getPacketType() == SX126X_PACKET_TYPE_LORA))) {
|
||||||
|
return(ERR_WRONG_MODEM);
|
||||||
|
}
|
||||||
|
|
||||||
// stop RTC counter
|
// stop RTC counter
|
||||||
uint8_t rtcStop = 0x00;
|
uint8_t rtcStop = 0x00;
|
||||||
int16_t state = writeRegister(SX126X_REG_RTC_STOP, &rtcStop, 1);
|
int16_t state = writeRegister(SX126X_REG_RTC_STOP, &rtcStop, 1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue