1
0
Fork 0
mirror of https://github.com/EdgeTX/edgetx.git synced 2025-07-23 16:25:12 +03:00
This commit is contained in:
Grieb 2015-09-16 22:12:55 -03:00
parent 6d52039266
commit 646cc937ac
3 changed files with 13 additions and 17 deletions

View file

@ -1677,6 +1677,7 @@ void ShowEepromWarnings(QWidget *parent, const QString &title, unsigned long err
std::bitset<NUM_ERRORS> errors(errorsFound); std::bitset<NUM_ERRORS> errors(errorsFound);
QStringList warningsList; QStringList warningsList;
if (errors.test(WARNING_WRONG_FIRMWARE)) { warningsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); } if (errors.test(WARNING_WRONG_FIRMWARE)) { warningsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); }
if (errors.test(OLD_VERSION)) { warningsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your eeprom is from an old version of OpenTX, upgrading!\n You should 'save as' to keep the old file as a backup."); }
QMessageBox msgBox(parent); QMessageBox msgBox(parent);
msgBox.setWindowTitle(title); msgBox.setWindowTitle(title);

View file

@ -1498,6 +1498,7 @@ enum EepromLoadErrors {
BACKUP_NOT_SUPPORTED, BACKUP_NOT_SUPPORTED,
HAS_WARNINGS, HAS_WARNINGS,
OLD_VERSION,
WARNING_WRONG_FIRMWARE, WARNING_WRONG_FIRMWARE,
NUM_ERRORS NUM_ERRORS

View file

@ -363,7 +363,10 @@ unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *e
std::cout << " version " << (unsigned int)version; std::cout << " version " << (unsigned int)version;
EepromLoadErrors version_error = checkVersion(version); EepromLoadErrors version_error = checkVersion(version);
if (version_error != NO_ERROR) { if (version_error == OLD_VERSION) {
errors.set(version_error);
errors.set(HAS_WARNINGS);
} else if (version_error == NOT_OPENTX) {
std::cout << " not open9x\n"; std::cout << " not open9x\n";
errors.set(version_error); errors.set(version_error);
return errors.to_ulong(); return errors.to_ulong();
@ -908,59 +911,46 @@ EepromLoadErrors OpenTxEepromInterface::checkVersion(unsigned int version)
switch(version) { switch(version) {
case 201: case 201:
// first version // first version
break;
case 202: case 202:
// channel order is now always RUD - ELE - THR - AIL // channel order is now always RUD - ELE - THR - AIL
// changes in timers // changes in timers
// ppmFrameLength added // ppmFrameLength added
// thrTraceSrc added // thrTraceSrc added
break;
case 203: case 203:
// mixers changed (for the trims use for change the offset of a mix) // mixers changed (for the trims use for change the offset of a mix)
// telemetry offset raised to -127 +127 // telemetry offset raised to -127 +127
// function switches now have a param on 4 bits // function switches now have a param on 4 bits
break;
case 204: case 204:
// telemetry changes (bars) // telemetry changes (bars)
break;
case 205: case 205:
// mixer changes (differential, negative curves)... // mixer changes (differential, negative curves)...
break;
// case 206: // case 206:
case 207: case 207:
// V4: Rotary Encoders position in FlightModes // V4: Rotary Encoders position in FlightModes
break;
case 208: case 208:
// Trim value in 16bits // Trim value in 16bits
// FrSky A1/A2 offset on 12bits // FrSky A1/A2 offset on 12bits
// ARM: More Mixers / Expos / CSW / FSW / CHNOUT // ARM: More Mixers / Expos / CSW / FSW / CHNOUT
break;
case 209: case 209:
// Add TrmR, TrmE, TrmT, TrmA as Mix sources // Add TrmR, TrmE, TrmT, TrmA as Mix sources
// Trims are now OFF / ON / Rud / Ele / Thr / Ail // Trims are now OFF / ON / Rud / Ele / Thr / Ail
break;
case 210: case 210:
// Add names in Mixes / Expos // Add names in Mixes / Expos
// Add a new telemetry screen // Add a new telemetry screen
// Add support for Play Track <filename> // Add support for Play Track <filename>
break;
case 211: case 211:
// Curves big change // Curves big change
break;
case 212: case 212:
// Big changes in mixers / limitse // Big changes in mixers / limitse
break;
case 213: case 213:
// GVARS / Variants introduction // GVARS / Variants introduction
break;
case 214: case 214:
// Massive EEPROM change! // Massive EEPROM change!
break;
case 215: case 215:
// M128 revert because too much RAM used! // M128 revert because too much RAM used!
break;
case 216: case 216:
// A lot of things (first github release) // A lot of things (first github release)
return OLD_VERSION;
break; break;
case 217: case 217:
// 3 logical switches removed on M128 / gruvin9x boards // 3 logical switches removed on M128 / gruvin9x boards
@ -1047,9 +1037,13 @@ unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *e
std::cout << " version " << (unsigned int)version << " "; std::cout << " version " << (unsigned int)version << " ";
if (!checkVersion(version)) { EepromLoadErrors version_error = checkVersion(version);
if (version_error == OLD_VERSION) {
errors.set(version_error);
errors.set(HAS_WARNINGS);
} else if (version_error == NOT_OPENTX) {
std::cout << " not open9x\n"; std::cout << " not open9x\n";
errors.set(NOT_OPENTX); errors.set(version_error);
return errors.to_ulong(); return errors.to_ulong();
} }