From 1acd23bf8c460e89413ec861ad8642f02f98d7e8 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 13 Oct 2015 15:04:35 +0200 Subject: [PATCH] Fixes #2942 - Needs more tests This bug was introduced when fixing #2787, I would like to be sure I don't reintroduce a bug there now... --- .../src/firmwares/opentx/opentxeeprom.cpp | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 0ac1e1d48..6d34cb994 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -269,15 +269,18 @@ class SourcesConversionTable: public ConversionTable { } if (!afterrelease21March2013) { - for (int i=0; i<3; i++) + for (int i=0; i<3; i++) { addConversion(RawSource(SOURCE_TYPE_CYC, i), val++); + } } - for (int i=0; i= 217) { @@ -296,8 +299,9 @@ class SourcesConversionTable: public ConversionTable { else { if (afterrelease21March2013) { if ((board != BOARD_STOCK && (board!=BOARD_M128 || version<215)) || (variant & GVARS_VARIANT)) { - for (int i=0; i(v3)); internalField.Append(new ConversionField< UnsignedField<8> >(csw.func, &functionsConversionTable, "Function")); } - else if (IS_ARM(board) && version >= 216) { - internalField.Append(new SignedField<8>(v1)); - internalField.Append(new SignedField<16>(v2)); - internalField.Append(new SignedField<16>(v3)); - internalField.Append(new ConversionField< UnsignedField<8> >(csw.func, &functionsConversionTable, "Function")); - } else if (IS_ARM(board) && version >= 215) { internalField.Append(new SignedField<16>(v1)); internalField.Append(new SignedField<16>(v2)); @@ -1785,7 +1783,7 @@ class LogicalSwitchField: public TransformedField { } } else if (csw.func != LS_FN_OFF) { - if (IS_ARM(board)) { + if (IS_ARM(board) && version >= 217) { sourcesConversionTable->importValue((uint32_t)v1, csw.val1); } else {