[LR11X0] FSK preamble detector length configuration (#1286)
* [LR11X0] pay more attention to selection of FSK preamble detector length
This commit is contained in:
parent
8bc4b9a330
commit
434afa52f2
1 changed files with 5 additions and 1 deletions
|
@ -1117,7 +1117,11 @@ int16_t LR11x0::setPreambleLength(size_t preambleLength) {
|
|||
return(setPacketParamsLoRa(this->preambleLengthLoRa, this->headerType, this->implicitLen, this->crcTypeLoRa, (uint8_t)this->invertIQEnabled));
|
||||
} else if(type == RADIOLIB_LR11X0_PACKET_TYPE_GFSK) {
|
||||
this->preambleLengthGFSK = preambleLength;
|
||||
this->preambleDetLength = RADIOLIB_LR11X0_GFSK_PREAMBLE_DETECT_16_BITS;
|
||||
this->preambleDetLength = preambleLength >= 32 ? RADIOLIB_LR11X0_GFSK_PREAMBLE_DETECT_32_BITS :
|
||||
preambleLength >= 24 ? RADIOLIB_LR11X0_GFSK_PREAMBLE_DETECT_24_BITS :
|
||||
preambleLength >= 16 ? RADIOLIB_LR11X0_GFSK_PREAMBLE_DETECT_16_BITS :
|
||||
preambleLength > 0 ? RADIOLIB_LR11X0_GFSK_PREAMBLE_DETECT_8_BITS :
|
||||
RADIOLIB_LR11X0_GFSK_PREAMBLE_DETECT_DISABLED;
|
||||
return(setPacketParamsGFSK(this->preambleLengthGFSK, this->preambleDetLength, this->syncWordLength, this->addrComp, this->packetType, RADIOLIB_LR11X0_MAX_PACKET_LENGTH, this->crcTypeGFSK, this->whitening));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue