Merge pull request #458 from Arthurk12/packetLength
[Si443x] Fixes getPacketLength
This commit is contained in:
commit
b3922470c4
1 changed files with 5 additions and 2 deletions
|
@ -512,9 +512,12 @@ int16_t Si443x::setPreambleLength(uint8_t preambleLen) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Si443x::getPacketLength(bool update) {
|
size_t Si443x::getPacketLength(bool update) {
|
||||||
/// \todo variable length mode
|
|
||||||
if(!_packetLengthQueried && update) {
|
if(!_packetLengthQueried && update) {
|
||||||
_packetLength = _mod->SPIreadRegister(RADIOLIB_SI443X_REG_RECEIVED_PACKET_LENGTH);
|
if (_packetLengthConfig == RADIOLIB_SI443X_FIXED_PACKET_LENGTH_ON) {
|
||||||
|
_packetLength = _mod->SPIreadRegister(RADIOLIB_SI443X_REG_TRANSMIT_PACKET_LENGTH);
|
||||||
|
} else {
|
||||||
|
_packetLength = _mod->SPIreadRegister(RADIOLIB_SI443X_REG_RECEIVED_PACKET_LENGTH);
|
||||||
|
}
|
||||||
_packetLengthQueried = true;
|
_packetLengthQueried = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue