Skip to content

Commit

Permalink
Read custom config from device if loading the cached data fails
Browse files Browse the repository at this point in the history
  • Loading branch information
vedderb committed Jul 6, 2024
1 parent 48e6e34 commit 1473a5f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions vescinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3813,13 +3813,13 @@ void VescInterface::fwVersionReceived(FW_RX_PARAMS params)
auto confData = f.readAll();
f.close();

if (!mCustomConfigs.last()->loadCompressedParamsXml(confData)) {
readConfigsOk = false;
break;
if (mCustomConfigs.last()->loadCompressedParamsXml(confData)) {
emitStatusMessage(QString("Got cached %1").arg(mCustomConfigs.last()->getLongName("hw_name")), true);
continue;
} else {
mCustomConfigs.last()->deleteLater();
mCustomConfigs.removeLast();
}

emitStatusMessage(QString("Got cached %1").arg(mCustomConfigs.last()->getLongName("hw_name")), true);
continue;
}
}

Expand Down

0 comments on commit 1473a5f

Please sign in to comment.