diff --git a/companion/src/firmwares/boards.cpp b/companion/src/firmwares/boards.cpp index 6e2f92aa4..6a82015cc 100644 --- a/companion/src/firmwares/boards.cpp +++ b/companion/src/firmwares/boards.cpp @@ -432,13 +432,13 @@ int Boards::getCapability(Board::Type board, Board::Capability capability) return 0; case MouseAnalogs: - if (IS_HORUS_X12S(board)) + if (IS_FAMILY_HORUS_OR_T16(board)) return 2; else return 0; case GyroAnalogs: - if (IS_TARANIS_XLITES(board)) + if (IS_TARANIS_XLITES(board) || IS_FAMILY_HORUS_OR_T16(board)) return 2; else return 0; @@ -591,12 +591,12 @@ StringTagMappingTable Boards::getAnalogNamesLookupTable(Board::Type board) {"LS", "SLIDER3"}, {"RS", "SLIDER4"}, }); - } else if (IS_TARANIS_XLITE(board)) { + } else if (IS_TARANIS_XLITES(board)) { tbl.insert(tbl.end(), { {"S1", "POT1"}, {"S2", "POT2"}, - {"GyrX", "GYRO1"}, - {"GyrY", "GYRO2"}, + {"TltX", "TILT_X"}, + {"TltY", "TILT_Y"}, }); } else if ((IS_TARANIS_SMALL(board) && !IS_JUMPER_TLITE(board)) || IS_FLYSKY_NV14(board)) { tbl.insert(tbl.end(), { @@ -622,6 +622,8 @@ StringTagMappingTable Boards::getAnalogNamesLookupTable(Board::Type board) {"RS", "RS"}, {"JSx", "MOUSE1"}, {"JSy", "MOUSE2"}, + {"TltX", "TILT_X"}, + {"TltY", "TILT_Y"}, }); } else if (IS_HORUS_X10(board) || IS_FAMILY_T16(board)) { tbl.insert(tbl.end(), { @@ -634,6 +636,10 @@ StringTagMappingTable Boards::getAnalogNamesLookupTable(Board::Type board) {"EX4", "EXT4"}, {"LS", "LS"}, {"RS", "RS"}, + {"JSx", "MOUSE1"}, + {"JSy", "MOUSE2"}, + {"TltX", "TILT_X"}, + {"TltY", "TILT_Y"}, }); } diff --git a/companion/src/firmwares/edgetx/yaml_rawsource.cpp b/companion/src/firmwares/edgetx/yaml_rawsource.cpp index aec41396b..3b78b06a3 100644 --- a/companion/src/firmwares/edgetx/yaml_rawsource.cpp +++ b/companion/src/firmwares/edgetx/yaml_rawsource.cpp @@ -250,6 +250,16 @@ RawSource YamlRawSourceDecode(const std::string& src_str) YAML::Node node(src_str); std::string ana_str; node >> ana_str; + + // 2.8 conversion of GYRO1 and GYRO2 to TILT_X and TILT_Y respectively + if (ana_str.size() == 5) { + if (ana_str.substr(0, 5) == "GYRO1") { + ana_str = "TILT_X"; + } else if (ana_str.substr(0, 5) == "GYRO2") { + ana_str = "TILT_Y"; + } + } + int ana_idx = getCurrentFirmware()->getAnalogInputIndex(ana_str.c_str()); if (ana_idx >= 0) { rhs.type = SOURCE_TYPE_STICK; diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 0be495661..c24b2c9c0 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -29,8 +29,6 @@ using namespace Board; #define MAX_VIEWS(board) (HAS_LARGE_LCD(board) ? 2 : 256) -#define MAX_GYRO_ANALOGS(board, version) (version >= 219 ? Boards::getCapability(board, Board::GyroAnalogs) : 0) - inline int MAX_SWITCHES(Board::Type board, int version) { if (version <= 218) { @@ -188,6 +186,16 @@ inline int MAX_MOUSE_ANALOG_SOURCES(Board::Type board, int version) return 0; } +inline int MAX_GYRO_ANALOGS(Board::Type board, int version) +{ + if (version <= 220) { + if (IS_FAMILY_HORUS_OR_T16(board)) + return 0; + } + + return Boards::getCapability(board, Board::GyroAnalogs); +} + #define MAX_ROTARY_ENCODERS(board) 0 #define MAX_FLIGHT_MODES(board, version) 9 #define MAX_TIMERS(board, version) 3