Add Jumper t12 support by 3djc (#6451)

* Jumper T12 - companion part

* more work

* Add definitions

* fix libsimulator key handling

* Fix simu keys handling

* Cosmetics

* Continued

* Fix wrong regplace

* Fix wrong regplace

* Please travis

* Please travis

* Add T12 to Travis
Switch naming and display

* Cosmetics

* Work on modules

* Work on modules

* typo

* Fix navigation

* Cosmetics

* Introduce NAVIGATION_type

* Fix

* Make NAVIGATION_type more future proof

* Lots of cleanups and improvements

* Cosmetics

* Fix internal module menu

* Cosmetics

* Fix screen reversed

* Small fixes

* Fix navigation issue

* Please travis

* Fix LCD contrast

* Fix T12 switch layout

* Fix T12 keys screen and all radios keys translations

* Complete rework of SWITCHES screen for all radios

* comsetics

* VC++ compilation
This commit is contained in:
3djc
2019-05-26 19:51:17 +02:00
committed by Andre Bernet
parent f0998ff52f
commit cd3c4ac654
80 changed files with 975 additions and 208 deletions
@@ -66,6 +66,8 @@ const char * OpenTxEepromInterface::getName()
return "OpenTX for MEGA2560 board";
case BOARD_GRUVIN9X:
return "OpenTX for Gruvin9x board / 9X";
case BOARD_JUMPER_T12:
return "OpenTX for Jumper T12";
case BOARD_TARANIS_X9D:
return "OpenTX for FrSky Taranis X9D";
case BOARD_TARANIS_X9DP:
@@ -331,6 +333,9 @@ int OpenTxEepromInterface::save(uint8_t * eeprom, const RadioData & radioData, u
else if (IS_TARANIS_XLITE(board)) {
variant |= TARANIS_XLITE_VARIANT;
}
else if (IS_JUMPER_T12(board)) {
variant |= JUMPER_T12_VARIANT;
}
OpenTxGeneralData generator((GeneralSettings &)radioData.generalSettings, board, version, variant);
// generator.dump();
@@ -543,7 +548,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
case SoundPitch:
return 1;
case Haptic:
return (IS_2560(board) || IS_SKY9X(board) || IS_TARANIS_PLUS(board) || IS_TARANIS_SMALL(board) || IS_TARANIS_X9E(board) || IS_HORUS(board) || id.contains("haptic"));
return (IS_2560(board) || IS_SKY9X(board) || IS_TARANIS_PLUS(board) || IS_TARANIS_SMALL(board) || IS_TARANIS_X9E(board) || IS_HORUS(board) || IS_JUMPER_T12(board) || id.contains("haptic"));
case ModelTrainerEnable:
if (IS_HORUS_OR_TARANIS(board))
return 1;
@@ -552,7 +557,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
case MaxVolume:
return (IS_ARM(board) ? 23 : 7);
case MaxContrast:
if (IS_TARANIS_SMALL(board))
if (IS_TARANIS_SMALL(board) || IS_JUMPER_T12(board))
return 30;
else
return 45;
@@ -644,7 +649,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
case LcdWidth:
if (IS_HORUS(board))
return 480;
else if (IS_TARANIS_SMALL(board))
else if (IS_TARANIS_SMALL(board) || IS_JUMPER_T12(board))
return 128;
else if (IS_TARANIS(board))
return 212;
@@ -658,7 +663,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
case LcdDepth:
if (IS_HORUS(board))
return 16;
else if (IS_TARANIS_SMALL(board))
else if (IS_TARANIS_SMALL(board) || IS_JUMPER_T12(board))
return 1;
else if (IS_TARANIS(board))
return 4;
@@ -708,6 +713,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
return TARANIS_XLITES_VARIANT;
else if (IS_TARANIS_XLITE(board))
return TARANIS_XLITE_VARIANT;
else if (IS_JUMPER_T12(board))
return JUMPER_T12_VARIANT;
else
return 0;
case MavlinkTelemetry:
@@ -973,6 +980,11 @@ bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int vari
variantError = true;
}
}
else if (IS_JUMPER_T12(board)) {
if (variant != JUMPER_T12_VARIANT) {
variantError = true;
}
}
if (variantError) {
qWarning() << " wrong variant (" << variant << ")";
@@ -1242,6 +1254,17 @@ void registerOpenTxFirmwares()
firmware->addOption("pcbdev", Firmware::tr("Use ONLY with first DEV pcb version"));
registerOpenTxFirmware(firmware);
/* Jumper T12 board */
firmware = new OpenTxFirmware("opentx-t12", QCoreApplication::translate("Firmware", "Jumper T12"), BOARD_JUMPER_T12);
addOpenTxCommonOptions(firmware);
firmware->addOption("noheli", Firmware::tr("Disable HELI menu and cyclic mix support"));
firmware->addOption("nogvars", Firmware::tr("Disable Global variables"));
firmware->addOption("lua", Firmware::tr("Enable Lua custom scripts screen"));
firmware->addOption("luac", Firmware::tr("Enable Lua compiler"));
firmware->addOption("crossfire", Firmware::tr("Support for Crossfire TX Module"));
addOpenTxFontOptions(firmware);
registerOpenTxFirmware(firmware);
/* 9XR-Pro */
firmware = new OpenTxFirmware("opentx-9xrpro", Firmware::tr("Turnigy 9XR-PRO"), BOARD_9XRPRO);
addOpenTxArm9xOptions(firmware, false);