[SX1280] Only check ranging address on slave

This commit is contained in:
jgromes 2023-01-01 18:03:48 +01:00
parent 395844922c
commit 088207df4c

View file

@ -57,6 +57,7 @@ int16_t SX1280::startRanging(bool master, uint32_t addr) {
RADIOLIB_ASSERT(state);
// check all address bits
if(!master) {
uint8_t regValue;
state = readRegister(RADIOLIB_SX128X_REG_SLAVE_RANGING_ADDRESS_WIDTH, &regValue, 1);
RADIOLIB_ASSERT(state);
@ -64,6 +65,7 @@ int16_t SX1280::startRanging(bool master, uint32_t addr) {
regValue |= 0b11000000;
state = writeRegister(RADIOLIB_SX128X_REG_SLAVE_RANGING_ADDRESS_WIDTH, &regValue, 1);
RADIOLIB_ASSERT(state);
}
// set remaining parameter values
uint32_t addrReg = RADIOLIB_SX128X_REG_SLAVE_RANGING_ADDRESS_BYTE_3;