From aed219cbd1d95bb3d14218e59f99df6c0e029a84 Mon Sep 17 00:00:00 2001 From: bsongis Date: Sun, 2 Mar 2014 14:35:42 +0100 Subject: [PATCH] EEPROM conversions problems --- .../src/firmwares/opentx/opentxeeprom.cpp | 18 ++++-- radio/src/eeprom_conversions.cpp | 55 +++++++++++++++++++ 2 files changed, 69 insertions(+), 4 deletions(-) diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 6b278c712..0ce62a612 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -1091,7 +1091,7 @@ class CurvesField: public TransformedField { CurveData *curve = &curves[i]; int size = (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count); if (offset+size > maxPoints) { - EEPROMWarnings += ::QObject::tr("openTx only accepts %1 points in all curves").arg(maxPoints) + "\n"; + EEPROMWarnings += ::QObject::tr("OpenTX only accepts %1 points in all curves").arg(maxPoints) + "\n"; break; } if (!IS_TARANIS(board) || version < 216) { @@ -1128,6 +1128,16 @@ class CurvesField: public TransformedField { } } + if (curve->count > 17) { + qDebug() << "Wrong points count" << curve->count; + curve->count = 0; + for (int j=0; jclear(5); + } + return; + } + for (int j=0; jcount; j++) { curve->points[j].y = *cur++; } @@ -2518,11 +2528,11 @@ void Open9xGeneralDataNew::beforeExport() int count = 0; for (int i=0; i