set implicit params with extra SPI call where required
This commit is contained in:
parent
870a135b15
commit
07429986c2
1 changed files with 16 additions and 0 deletions
|
@ -290,6 +290,14 @@ int16_t SX126x::receive(uint8_t* data, size_t len) {
|
||||||
float symbolLength = (float)(uint32_t(1) << _sf) / (float)_bwKhz;
|
float symbolLength = (float)(uint32_t(1) << _sf) / (float)_bwKhz;
|
||||||
timeout = (uint32_t)(symbolLength * 100.0 * 1000.0);
|
timeout = (uint32_t)(symbolLength * 100.0 * 1000.0);
|
||||||
|
|
||||||
|
// set implicit mode and expected len if applicable
|
||||||
|
if (_headerType == SX126X_LORA_HEADER_IMPLICIT) {
|
||||||
|
state = setPacketParams(_preambleLength, _crcType, _implicitLen, _headerType);
|
||||||
|
if(state != ERR_NONE) {
|
||||||
|
return(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else if(modem == SX126X_PACKET_TYPE_GFSK) {
|
} else if(modem == SX126X_PACKET_TYPE_GFSK) {
|
||||||
// calculate timeout (500 % of expected time-one-air)
|
// calculate timeout (500 % of expected time-one-air)
|
||||||
size_t maxLen = len;
|
size_t maxLen = len;
|
||||||
|
@ -600,6 +608,14 @@ int16_t SX126x::startReceiveCommon() {
|
||||||
// clear interrupt flags
|
// clear interrupt flags
|
||||||
state = clearIrqStatus();
|
state = clearIrqStatus();
|
||||||
|
|
||||||
|
// set implicit mode and expected len if applicable
|
||||||
|
if (_headerType == SX126X_LORA_HEADER_IMPLICIT && getPacketType() == SX126X_PACKET_TYPE_LORA) {
|
||||||
|
state = setPacketParams(_preambleLength, _crcType, _implicitLen, _headerType);
|
||||||
|
if(state != ERR_NONE) {
|
||||||
|
return(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return(state);
|
return(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue