diff --git a/companion/src/burndialog.cpp b/companion/src/burndialog.cpp index 21bdc3f19..87abea369 100644 --- a/companion/src/burndialog.cpp +++ b/companion/src/burndialog.cpp @@ -193,7 +193,7 @@ void burnDialog::checkFw(QString fileName) ui->FramFWInfo->show(); ui->DateField->setText(flash.getDate() + " " + flash.getTime()); ui->versionField->setText(flash.getVersion()); - ui->ModField->setText(flash.getEEprom()); + ui->ModField->setText(flash.getEEpromId()); ui->SplashFrame->hide(); if (flash.hasSplash()) { diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index b7a5df9aa..ee24329cc 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -154,7 +154,7 @@ bool OpenTxEepromInterface::loadModelVariant(unsigned int index, ModelData &mode int numbytes = efile->readRlc2((uint8_t *)eepromData.data(), eepromData.size()); if (numbytes) { open9xModel.Import(eepromData); - // open9xModel.Dump(); + open9xModel.Dump(); model.used = true; } else { diff --git a/companion/src/flashinterface.cpp b/companion/src/flashinterface.cpp index c0024a404..0104cd6c4 100644 --- a/companion/src/flashinterface.cpp +++ b/companion/src/flashinterface.cpp @@ -69,7 +69,17 @@ FlashInterface::FlashInterface(QString fileName): version = seekLabel(VERS_MARK); date = seekLabel(DATE_MARK); time = seekLabel(TIME_MARK); - eeprom = seekLabel(EEPR_MARK); + eepromId = seekLabel(EEPR_MARK); + + if (eepromId.contains('-')) { + QStringList list = eepromId.split('-'); + eepromVersion = list[0].toInt(); + eepromVariant = list[1].toInt(); + } + else { + eepromVersion = eepromId.toInt(); + } + versionId = version2index(version); SeekSplash(); isValidFlag = true; diff --git a/companion/src/flashinterface.h b/companion/src/flashinterface.h index db6b8fa87..bd10b7765 100644 --- a/companion/src/flashinterface.h +++ b/companion/src/flashinterface.h @@ -49,7 +49,9 @@ class FlashInterface int getSize() { return flash_size; } inline QString getVersion() { return version; } unsigned int getVersionId() { return versionId; } - inline QString getEEprom() { return eeprom; } + inline int getEEpromVersion() { return eepromVersion; } + inline int getEEpromVariant() { return eepromVariant; } + inline QString getEEpromId() { return eepromId; } QImage getSplash(); bool setSplash(const QImage & newsplash); bool hasSplash(); @@ -72,7 +74,9 @@ class FlashInterface QString time; QString version; int versionId; - QString eeprom; + QString eepromId; + int eepromVersion; + int eepromVariant; QByteArray splash; uint splash_offset; uint splash_size; diff --git a/companion/src/mainwindow.cpp b/companion/src/mainwindow.cpp index d26b33997..7ed81622b 100644 --- a/companion/src/mainwindow.cpp +++ b/companion/src/mainwindow.cpp @@ -990,7 +990,6 @@ bool MainWindow::readFirmwareFromRadio(const QString filename) ad->setWindowIcon(CompanionIcon("read_flash.png")); ad->exec(); delete ad; - sleep(1); result = true; } } @@ -1067,7 +1066,6 @@ bool MainWindow::readEepromFromRadio(const QString filename, const QString messa ad->setWindowIcon(CompanionIcon("read_eeprom.png")); ad->exec(); delete ad; - sleep(1); result = true; } } @@ -1078,7 +1076,6 @@ bool MainWindow::readEepromFromRadio(const QString filename, const QString messa ad->setWindowIcon(CompanionIcon("read_eeprom.png")); ad->exec(); delete ad; - sleep(1); result = true; } @@ -1267,11 +1264,8 @@ bool MainWindow::convertEEPROM(QString backupFile, QString restoreFile, QString if (!flash.isValid()) return false; - unsigned int version = 0; - unsigned int variant = 0; - - QString fwEEprom = flash.getEEprom(); - version = fwEEprom.toInt(); + unsigned int version = flash.getEEpromVersion(); + unsigned int variant = flash.getEEpromVariant(); QFile file(backupFile); int eeprom_size = file.size(); @@ -1333,7 +1327,7 @@ void MainWindow::writeFlash(QString fileToFlash) if (backupEnable) { QDateTime datetime; backupFile.clear(); - backupFile=backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin"; + backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin"; } if (readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"))) {