Fixes #1997: firmware upload failed when "Check Firmware Compatibility" was selected (ported from master)

This commit is contained in:
Damjan Adamic
2015-01-14 19:23:12 +01:00
parent 27314d04cf
commit fcbe4572b8
4 changed files with 25 additions and 1 deletions
+4
View File
@@ -251,12 +251,14 @@ bool readFirmware(const QString &filename, ProgressWidget *progress)
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
QString path = findMassstoragePath("FIRMWARE.BIN");
if (!path.isEmpty()) {
qDebug() << "readFirmware: reading" << path << "into" << filename;
CopyProcess copyProcess(path, filename, progress);
result = copyProcess.run();
}
}
if (result == false) {
qDebug() << "readFirmware: reading" << filename << "with" << getRadioInterfaceCmd() << getReadFirmwareArgs(filename);
FlashProcess flashProcess(getRadioInterfaceCmd(), getReadFirmwareArgs(filename), progress);
result = flashProcess.run();
}
@@ -273,11 +275,13 @@ bool writeFirmware(const QString &filename, ProgressWidget *progress)
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
QString path = findMassstoragePath("FIRMWARE.BIN");
if (!path.isEmpty()) {
qDebug() << "writeFirmware: writing" << path << "from" << filename;
CopyProcess copyProcess(filename, path, progress);
return copyProcess.run();
}
}
qDebug() << "writeFirmware: writing" << filename << "with" << getRadioInterfaceCmd() << getWriteFirmwareArgs(filename);
FlashProcess flashProcess(getRadioInterfaceCmd(), getWriteFirmwareArgs(filename), progress);
return flashProcess.run();
}