fix module frequency overriding

The `RadioInterface::freq` member was encapsulated with the `RadioInterface::getFreq()` function,
which could be overridden in child classes for some LoRa-modules.
This commit is contained in:
Vladislav Osmanov
2021-09-13 22:13:51 +03:00
parent da61090dc5
commit cb42440963
5 changed files with 9 additions and 11 deletions

View File

@@ -52,7 +52,7 @@ bool SX126xInterface<T>::init()
limitPower();
int res = lora.begin(freq, bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage, useRegulatorLDO);
int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage, useRegulatorLDO);
// \todo Display actual typename of the adapter, not just `SX126x`
DEBUG_MSG("SX126x init result %d\n", res);
@@ -135,7 +135,7 @@ bool SX126xInterface<T>::reconfigure()
err = lora.setPreambleLength(preambleLength);
assert(err == ERR_NONE);
err = lora.setFrequency(freq);
err = lora.setFrequency(getFreq());
if (err != ERR_NONE)
RECORD_CRITICALERROR(CriticalErrorCode_InvalidRadioSetting);