diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index 052b5a176..38a4787c7 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -195,12 +195,12 @@ QString AnalogString(int index) { static const QString sticks[] = { QObject::tr("Rud"), QObject::tr("Ele"), QObject::tr("Thr"), QObject::tr("Ail") }; static const QString pots9X[] = { QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3") }; - static const QString potsX9D[] = { QObject::tr("S1"), QObject::tr("S2"), QObject::tr("LS"), QObject::tr("RS") }; + static const QString potsTaranis[] = { QObject::tr("S1"), QObject::tr("S2"), QObject::tr("S3"), QObject::tr("LS"), QObject::tr("RS") }; if (index < 4) return CHECK_IN_ARRAY(sticks, index); else - return (IS_TARANIS(GetEepromInterface()->getBoard()) ? CHECK_IN_ARRAY(potsX9D, index-4) : CHECK_IN_ARRAY(pots9X, index-4)); + return (IS_TARANIS(GetEepromInterface()->getBoard()) ? CHECK_IN_ARRAY(potsTaranis, index-4) : CHECK_IN_ARRAY(pots9X, index-4)); } QString RotaryEncoderString(int index) @@ -316,7 +316,8 @@ QString RawSwitch::toString() static const QString multiposPots[] = { QObject::tr("S11"), QObject::tr("S12"), QObject::tr("S13"), QObject::tr("S14"), QObject::tr("S15"), QObject::tr("S16"), - QObject::tr("S21"), QObject::tr("S22"), QObject::tr("S23"), QObject::tr("S24"), QObject::tr("S25"), QObject::tr("S26") + QObject::tr("S21"), QObject::tr("S22"), QObject::tr("S23"), QObject::tr("S24"), QObject::tr("S25"), QObject::tr("S26"), + QObject::tr("S31"), QObject::tr("S32"), QObject::tr("S33"), QObject::tr("S34"), QObject::tr("S35"), QObject::tr("S36") }; static const QString trimsSwitches[] = { diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index 4778f06e1..c73d9da77 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -159,8 +159,7 @@ enum HeliSwashTypes { #define NUM_STICKS 4 #define BOARD_9X_NUM_POTS 3 -#define BOARD_X9D_NUM_POTS 4 -#define C9X_NUM_POTS 4 +#define C9X_NUM_POTS 5 #define NUM_CAL_PPM 4 #define NUM_CYC 3 #define C9X_NUM_SWITCHES 10 diff --git a/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp b/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp index 13db450d7..f147e1fc5 100644 --- a/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp +++ b/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp @@ -148,7 +148,7 @@ inline int geteepromsize() { #include "radio/src/lua/src/lcorolib.c" -int16_t g_anas[NUM_STICKS+BOARD_X9D_NUM_POTS]; +int16_t g_anas[NUM_STICKS+5]; uint16_t anaIn(uint8_t chan) { diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 5be9f0917..6b278c712 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -11,7 +11,7 @@ #define HAS_PERSISTENT_TIMERS(board) (IS_ARM(board) || board == BOARD_GRUVIN9X) #define HAS_LARGE_LCD(board) IS_TARANIS(board) #define MAX_VIEWS(board) (HAS_LARGE_LCD(board) ? 2 : 256) -#define MAX_POTS(board) (IS_TARANIS(board) ? 4 : 3) +#define MAX_POTS(board, version) (IS_TARANIS(board) ? (version>=216 ? 5 : 4) : 3) #define MAX_SWITCHES(board) (IS_TARANIS(board) ? 8 : 7) #define MAX_SWITCHES_POSITION(board) (IS_TARANIS(board) ? 22 : 9) #define MAX_ROTARY_ENCODERS(board) (board==BOARD_GRUVIN9X ? 2 : (board==BOARD_SKY9X ? 1 : 0)) @@ -60,8 +60,8 @@ class SwitchesConversionTable: public ConversionTable { addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++); } - if (version >= 216) { - for (int i=1; i<=GetEepromInterface()->getCapability(MultiposPots) * GetEepromInterface()->getCapability(MultiposPotsPositions); i++) { + if (IS_TARANIS(board) && version >= 216) { + for (int i=1; i<=3*6; i++) { addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, -i), -val+offset); addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i), val++); } @@ -172,7 +172,7 @@ class SourcesConversionTable: public ConversionTable { } } - for (int i=0; i<4+MAX_POTS(board); i++) + for (int i=0; i<4+MAX_POTS(board, version); i++) addConversion(RawSource(SOURCE_TYPE_STICK, i), val++); for (int i=0; i