diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 331ab2146..24d789fa0 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -25,6 +25,7 @@ #define MAX_CUSTOM_FUNCTIONS(board, version) (IS_ARM(board) ? (version >= 216 ? 64 : 32) : (IS_DBLEEPROM(board, version) ? 24 : 16)) #define MAX_CURVES(board, version) (IS_ARM(board) ? ((HAS_LARGE_LCD(board) && version >= 216) ? 32 : 16) : 8) #define MAX_GVARS(board, version) ((IS_ARM(board) && version >= 216) ? 9 : 5) +#define MAX_SCRIPTS(board) (IS_HORUS(board) ? 9 : 7) #define MAX_TELEMETRY_SENSORS(board, version) (32) #define NUM_PPM_INPUTS(board, version) ((IS_ARM(board) && version >= 216) ? 16 : 8) #define ROTENC_COUNT(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 218) ? 0 : 1) : (IS_2560(board) ? 2 : 0)) @@ -211,11 +212,11 @@ class SourcesConversionTable: public ConversionTable { addConversion(RawSource(SOURCE_TYPE_NONE), val++); } - if (IS_TARANIS(board) && version >= 216) { + if (IS_STM32(board) && version >= 216) { for (int i=0; i<32; i++) { addConversion(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i), val++); } - for (int i=0; i<7; i++) { + for (int i=0; i= 216) { + if (IS_STM32(board) && version >= 216) { expo.offset = smallGvarToC9x(_offset); } - if (!IS_TARANIS(board) || version < 216) { + if (!IS_STM32(board) || version < 216) { if (!_curveMode) expo.curve = CurveReference(CurveReference::CURVE_REF_EXPO, smallGvarToC9x(_curveParam)); else if (_curveParam > 6) @@ -1533,7 +1534,7 @@ class CurvesField: public TransformedField { for (int i=0; i= 216) { + if (IS_STM32(board) && version >= 216) { offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count); if (offset > maxPoints) { EEPROMWarnings.push_back(::QObject::tr("OpenTX only accepts %1 points in all curves").arg(maxPoints)); @@ -1565,7 +1566,7 @@ class CurvesField: public TransformedField { for (int i=0; i >(_func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function"))); } - if (IS_TARANIS(board) && version >= 216) + if (IS_STM32(board) && version >= 216) internalField.Append(new CharField<8>(_param, false)); else if (IS_TARANIS(board)) internalField.Append(new CharField<10>(_param, false));