From 0029f57413d77fd1dc5891141cb9605ff94d5fa9 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Mon, 24 Feb 2014 19:52:35 +0100 Subject: [PATCH] Conversions from older EEPROM for duration/delay fields (x5) --- companion/src/firmwares/opentx/opentxeeprom.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 37f148900..dff4d73fb 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -1196,8 +1196,9 @@ class LogicalSwitchField: public TransformedField { if (IS_ARM(board)) { internalField.Append(new ConversionField< UnsignedField<8> >(csw.func, &functionsConversionTable, "Function")); - internalField.Append(new UnsignedField<8>(csw.delay)); - internalField.Append(new UnsignedField<8>(csw.duration)); + int scale = (version >= 216 ? 0 : 5); + internalField.Append(new ConversionField< UnsignedField<8> >(csw.delay, 0, scale)); + internalField.Append(new ConversionField< UnsignedField<8> >(csw.duration, 0, scale)); if (version >= 214) { internalField.Append(new ConversionField< SignedField<8> >((int &)csw.andsw, andswitchesConversionTable, "AND switch")); }