EEPROM Backup/Restore problem on 9X128 (variant not used correctly)

This commit is contained in:
bsongis
2014-06-11 11:58:57 +02:00
parent 3fe75fac59
commit 5c4b2ebd90
5 changed files with 22 additions and 14 deletions
+1 -1
View File
@@ -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()) {
@@ -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 {
+11 -1
View File
@@ -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;
+6 -2
View File
@@ -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;
+3 -9
View File
@@ -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"))) {