From 7162ab53999e1ebc76a440a57c9aec8c725dcdcf Mon Sep 17 00:00:00 2001 From: bsongis Date: Tue, 1 Jul 2014 19:52:45 +0200 Subject: [PATCH] Warning raised by Valgrind --- .../src/firmwares/opentx/opentxeeprom.cpp | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 8961bff4e..b549e5a6d 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -2804,10 +2804,12 @@ void OpenTxGeneralData::beforeExport() sum += generalData.calibSpanPos[i]; if (++count == 12) break; } - for (int i=0; i<4; i++) { - potsType[i] = generalData.potsType[i]; - if (i<2 && potsType[i] == 1) - potsType[i] = 0; + if (IS_TARANIS(board)) { + for (int i=0; i<4; i++) { + potsType[i] = generalData.potsType[i]; + if (i<2 && potsType[i] == 1) + potsType[i] = 0; + } } } else { @@ -2821,9 +2823,11 @@ void OpenTxGeneralData::beforeExport() void OpenTxGeneralData::afterImport() { - for (int i=0; i<4; i++) { - generalData.potsType[i] = potsType[i]; - if (i<2 && potsType[i] == 0) - generalData.potsType[i] = 1; + if (IS_TARANIS(board)) { + for (int i=0; i<4; i++) { + generalData.potsType[i] = potsType[i]; + if (i<2 && potsType[i] == 0) + generalData.potsType[i] = 1; + } } }