Fix: Set correct frequency when changing it via web ui
Previously it could happen that the frequency was changed between saving old and recovering new frequency. Therefor an invalid frequency was saved in the CMT module
This commit is contained in:
parent
f1f4322db5
commit
f3942bb647
@ -267,8 +267,6 @@ void HoymilesRadio_CMT::sendEsbPacket(CommandAbstract* cmd)
|
||||
|
||||
_radio->stopListening();
|
||||
|
||||
uint8_t oldChannel;
|
||||
oldChannel = _radio->getChannel();
|
||||
if (cmd->getDataPayload()[0] == 0x56) { // @todo(tbnobody) Bad hack to identify ChannelChange Command
|
||||
cmtSwitchDtuFreq(HOY_BOOT_FREQ / 1000);
|
||||
}
|
||||
@ -280,7 +278,7 @@ void HoymilesRadio_CMT::sendEsbPacket(CommandAbstract* cmd)
|
||||
if (!_radio->write(cmd->getDataPayload(), cmd->getDataSize())) {
|
||||
Hoymiles.getMessageOutput()->println("TX SPI Timeout");
|
||||
}
|
||||
_radio->setChannel(oldChannel);
|
||||
cmtSwitchDtuFreq(_inverterTargetFrequency);
|
||||
_radio->startListening();
|
||||
_busyFlag = true;
|
||||
_rxTimeout.set(cmd->getTimeout());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user