From 7db84849c0a2fb031562a14dea69b2e8b68ea6a5 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 29 Aug 2019 23:25:57 +0200 Subject: [PATCH] [Companion] X9D/X9D+/X9D+2019 EEPROM import / export fixes --- companion/src/firmwares/opentx/opentxeeprom.cpp | 2 +- companion/src/tests/conversions.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 05837c068..55d9a3def 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -2304,7 +2304,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig internalField.Append(new SwitchesWarningField<32>(this, modelData.switchWarningStates, board, version)); else if (IS_TARANIS_X9E(board)) internalField.Append(new SwitchesWarningField<64>(this, modelData.switchWarningStates, board, version)); - else if (IS_TARANIS_X9D(board)) + else if (version < 219 && IS_TARANIS_X9D(board)) internalField.Append(new SwitchesWarningField<32>(this, modelData.switchWarningStates, board, version)); else if (IS_TARANIS(board)) internalField.Append(new SwitchesWarningField<16>(this, modelData.switchWarningStates, board, version)); diff --git a/companion/src/tests/conversions.cpp b/companion/src/tests/conversions.cpp index 0d6b34272..9d29c1998 100644 --- a/companion/src/tests/conversions.cpp +++ b/companion/src/tests/conversions.cpp @@ -15,7 +15,7 @@ TEST(Conversions, ConversionX9DPFrom22) ASSERT_EQ(true, store.load(radioData)); const GeneralSettings& settings = radioData.generalSettings; - EXPECT_EQ(RawSwitch(SWITCH_TYPE_TELEMETRY,1), settings.customFn[0].swtch); + EXPECT_EQ(RawSwitch(SWITCH_TYPE_TELEMETRY, 1), settings.customFn[0].swtch); EXPECT_EQ(FuncLogs, settings.customFn[0].func); EXPECT_EQ(20, settings.customFn[0].param); @@ -24,7 +24,7 @@ TEST(Conversions, ConversionX9DPFrom22) const ModelData& model = radioData.models[0]; EXPECT_STREQ("Test", model.name); - EXPECT_EQ(RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_SA0), model.timers[0].mode); + EXPECT_EQ(RawSwitch(SWITCH_TYPE_SWITCH, SWITCH_SA0), model.timers[0].mode); EXPECT_EQ(80, model.mixData[0].weight); EXPECT_EQ(900, model.limitData[0].max); // -100 EXPECT_EQ(80, model.expoData[0].weight);