SX126x: Try next Interface when chip not found (#2363)

* If chip was not found, return false for init()

* SX1268: Only overwrite frequency when out of bounds
Happens when region is still UNSET
This commit is contained in:
GUVWAF
2023-03-18 13:23:37 +01:00
committed by GitHub
parent 1f99d4756a
commit 8c68d888c8
3 changed files with 12 additions and 2 deletions

View File

@@ -47,6 +47,8 @@ template <typename T> bool SX126xInterface<T>::init()
int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage, useRegulatorLDO);
// \todo Display actual typename of the adapter, not just `SX126x`
LOG_INFO("SX126x init result %d\n", res);
if (res == RADIOLIB_ERR_CHIP_NOT_FOUND)
return false;
LOG_INFO("Frequency set to %f\n", getFreq());
LOG_INFO("Bandwidth set to %f\n", bw);