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->FramFWInfo->show();
ui->DateField->setText(flash.getDate() + " " + flash.getTime()); ui->DateField->setText(flash.getDate() + " " + flash.getTime());
ui->versionField->setText(flash.getVersion()); ui->versionField->setText(flash.getVersion());
ui->ModField->setText(flash.getEEprom()); ui->ModField->setText(flash.getEEpromId());
ui->SplashFrame->hide(); ui->SplashFrame->hide();
if (flash.hasSplash()) { 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()); int numbytes = efile->readRlc2((uint8_t *)eepromData.data(), eepromData.size());
if (numbytes) { if (numbytes) {
open9xModel.Import(eepromData); open9xModel.Import(eepromData);
// open9xModel.Dump(); open9xModel.Dump();
model.used = true; model.used = true;
} }
else { else {
+11 -1
View File
@@ -69,7 +69,17 @@ FlashInterface::FlashInterface(QString fileName):
version = seekLabel(VERS_MARK); version = seekLabel(VERS_MARK);
date = seekLabel(DATE_MARK); date = seekLabel(DATE_MARK);
time = seekLabel(TIME_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); versionId = version2index(version);
SeekSplash(); SeekSplash();
isValidFlag = true; isValidFlag = true;
+6 -2
View File
@@ -49,7 +49,9 @@ class FlashInterface
int getSize() { return flash_size; } int getSize() { return flash_size; }
inline QString getVersion() { return version; } inline QString getVersion() { return version; }
unsigned int getVersionId() { return versionId; } 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(); QImage getSplash();
bool setSplash(const QImage & newsplash); bool setSplash(const QImage & newsplash);
bool hasSplash(); bool hasSplash();
@@ -72,7 +74,9 @@ class FlashInterface
QString time; QString time;
QString version; QString version;
int versionId; int versionId;
QString eeprom; QString eepromId;
int eepromVersion;
int eepromVariant;
QByteArray splash; QByteArray splash;
uint splash_offset; uint splash_offset;
uint splash_size; uint splash_size;
+3 -9
View File
@@ -990,7 +990,6 @@ bool MainWindow::readFirmwareFromRadio(const QString filename)
ad->setWindowIcon(CompanionIcon("read_flash.png")); ad->setWindowIcon(CompanionIcon("read_flash.png"));
ad->exec(); ad->exec();
delete ad; delete ad;
sleep(1);
result = true; result = true;
} }
} }
@@ -1067,7 +1066,6 @@ bool MainWindow::readEepromFromRadio(const QString filename, const QString messa
ad->setWindowIcon(CompanionIcon("read_eeprom.png")); ad->setWindowIcon(CompanionIcon("read_eeprom.png"));
ad->exec(); ad->exec();
delete ad; delete ad;
sleep(1);
result = true; result = true;
} }
} }
@@ -1078,7 +1076,6 @@ bool MainWindow::readEepromFromRadio(const QString filename, const QString messa
ad->setWindowIcon(CompanionIcon("read_eeprom.png")); ad->setWindowIcon(CompanionIcon("read_eeprom.png"));
ad->exec(); ad->exec();
delete ad; delete ad;
sleep(1);
result = true; result = true;
} }
@@ -1267,11 +1264,8 @@ bool MainWindow::convertEEPROM(QString backupFile, QString restoreFile, QString
if (!flash.isValid()) if (!flash.isValid())
return false; return false;
unsigned int version = 0; unsigned int version = flash.getEEpromVersion();
unsigned int variant = 0; unsigned int variant = flash.getEEpromVariant();
QString fwEEprom = flash.getEEprom();
version = fwEEprom.toInt();
QFile file(backupFile); QFile file(backupFile);
int eeprom_size = file.size(); int eeprom_size = file.size();
@@ -1333,7 +1327,7 @@ void MainWindow::writeFlash(QString fileToFlash)
if (backupEnable) { if (backupEnable) {
QDateTime datetime; QDateTime datetime;
backupFile.clear(); 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"))) { if (readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"))) {