1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 09:15:38 +03:00

3djc/x7 additional switches (#6422)

X7, add two additional switches
This commit is contained in:
Bertrand Songis 2019-05-13 22:59:45 +02:00 committed by GitHub
parent 00f68dadd2
commit 08de1a75e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 222 additions and 66 deletions

View file

@ -178,7 +178,9 @@ const SwitchInfo Boards::getSwitchInfo(Board::Type board, int index)
{SWITCH_3POS, "SC"},
{SWITCH_3POS, "SD"},
{SWITCH_2POS, "SF"},
{SWITCH_TOGGLE, "SH"}
{SWITCH_TOGGLE, "SH"},
{SWITCH_2POS, "SI"},
{SWITCH_2POS, "SJ"}
};
if (index < DIM(switches))
return switches[index];
@ -281,7 +283,7 @@ const int Boards::getCapability(Board::Type board, Board::Capability capability)
else if (IS_TARANIS_X9LITE(board))
return 5;
else if (IS_TARANIS_X7(board))
return 6;
return 8;
else if (IS_TARANIS_XLITES(board))
return 6;
else if (IS_TARANIS_XLITE(board))

View file

@ -31,7 +31,7 @@ using namespace Board;
#define MAX_SLIDERS(board) (IS_HORUS_X10(board) ? 4 : (Boards::getCapability(board, Board::Sliders))) //TODO need to be remove when x10 eeprom gets fixed
#define MAX_MOUSE_ANALOGS(board) (IS_HORUS_X10(board) ? 2 : (Boards::getCapability(board, Board::MouseAnalogs))) //TODO need to be remove when x10 eeprom gets fixed
#define MAX_GYRO_ANALOGS(board, version) (version >= 219 ? Boards::getCapability(board, Board::GyroAnalogs) : 0)
#define MAX_SWITCHES(board, version) (Boards::getCapability(board, Board::Switches))
#define MAX_SWITCHES(board, version) (version <= 218 && IS_TARANIS_X7(board) ? 6 : Boards::getCapability(board, Board::Switches))
#define MAX_SWITCH_SLOTS(board, version) (IS_TARANIS_X9E(board) ? 32 : 8) // bitsize of swconfig_t / 2 (see radio/src/datastructs.h)
#define MAX_SWITCHES_POSITION(board, version) (Boards::getCapability(board, Board::SwitchPositions))
#define MAX_ROTARY_ENCODERS(board) (IS_SKY9X(board) ? 1 : 0)