From b3f6f769fced4af846a7844b025693709fb30d56 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Fri, 23 Aug 2019 08:32:28 +0200 Subject: [PATCH] fixed X7 switch conversion table --- companion/src/firmwares/opentx/opentxeeprom.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 3feb72851..fdb1088f6 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -71,7 +71,15 @@ inline int MAX_SWITCH_SLOTS(Board::Type board, int version) return 8; } -#define MAX_SWITCHES_POSITION(board, version) (Boards::getCapability(board, Board::SwitchPositions)) +inline int MAX_SWITCHES_POSITION(Board::Type board, int version) +{ + if (version < 219 && IS_TARANIS_X7(board)) + return Boards::getCapability(board, Board::SwitchPositions) - 2*3; + + return Boards::getCapability(board, Board::SwitchPositions); +} + +//#define MAX_SWITCHES_POSITION(board, version) (Boards::getCapability(board, Board::SwitchPositions)) #define MAX_ROTARY_ENCODERS(board) (IS_SKY9X(board) ? 1 : 0) #define MAX_FLIGHT_MODES(board, version) 9 #define MAX_TIMERS(board, version) 3