[Si443x] Fixes getPacketLength
Fixes getPacketLength function to read the correct register when on fixed packet length mode.
This commit is contained in:
parent
7127433e3b
commit
2538af82a9
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) {
|
||||||
|
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);
|
_packetLength = _mod->SPIreadRegister(RADIOLIB_SI443X_REG_RECEIVED_PACKET_LENGTH);
|
||||||
|
}
|
||||||
_packetLengthQueried = true;
|
_packetLengthQueried = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue