Skip to content

Commit

Permalink
feat: support Jumper T20 V2 (#4701)
Browse files Browse the repository at this point in the history
Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
  • Loading branch information
3 people authored Mar 14, 2024
1 parent ab2b773 commit 84a90a7
Show file tree
Hide file tree
Showing 27 changed files with 149 additions and 57 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
- tlite
- t20
- t14
- t20v2
- tx12
- x10
- x12s
Expand Down Expand Up @@ -99,7 +100,7 @@ jobs:
- t16;t18
- t8;zorro;pocket;mt12;commando8
- tlite;tpro;tprov2;lr3pro
- t20;t14
- t20;t20v2;t14
- tx12;tx12mk2;boxer
- tx16s
- x10;x10-access
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- t16;t18
- t8;zorro;pocket;mt12;commando8
- tlite;tpro;tprov2;lr3pro
- t20;t14
- t20;t20v2;t14
- tx12;tx12mk2;boxer
- tx16s
- x10;x10-access
Expand Down
2 changes: 2 additions & 0 deletions companion/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ elseif(PCB STREQUAL X7 AND PCBREV STREQUAL TPROV2)
set(FLAVOUR tprov2)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL T20)
set(FLAVOUR t20)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL T20V2)
set(FLAVOUR t20v2)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL TX12)
set(FLAVOUR tx12)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL TX12MK2)
Expand Down
5 changes: 5 additions & 0 deletions companion/src/firmwares/boards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ int Boards::getEEpromSize(Board::Type board)
case BOARD_IFLIGHT_COMMANDO8:
case BOARD_JUMPER_T12:
case BOARD_JUMPER_T20:
case BOARD_JUMPER_T20V2:
case BOARD_JUMPER_TLITE:
case BOARD_JUMPER_TLITE_F4:
case BOARD_JUMPER_TPRO:
Expand Down Expand Up @@ -235,6 +236,7 @@ int Boards::getFlashSize(Type board)
case BOARD_IFLIGHT_COMMANDO8:
case BOARD_JUMPER_T12:
case BOARD_JUMPER_T20:
case BOARD_JUMPER_T20V2:
case BOARD_JUMPER_TLITE:
case BOARD_JUMPER_TLITE_F4:
case BOARD_JUMPER_TPRO:
Expand Down Expand Up @@ -533,6 +535,8 @@ QString Boards::getBoardName(Board::Type board)
return "Jumper T18";
case BOARD_JUMPER_T20:
return "Jumper T20";
case BOARD_JUMPER_T20V2:
return "Jumper T20 V2";
case BOARD_RADIOMASTER_TX16S:
return "Radiomaster TX16S";
case BOARD_RADIOMASTER_TX12:
Expand Down Expand Up @@ -661,6 +665,7 @@ int Boards::getDefaultInternalModules(Board::Type board)
case BOARD_RADIOMASTER_TX12_MK2:
case BOARD_IFLIGHT_COMMANDO8:
case BOARD_JUMPER_T20:
case BOARD_JUMPER_T20V2:
return (int)MODULE_TYPE_CROSSFIRE;

case BOARD_FLYSKY_NV14:
Expand Down
4 changes: 3 additions & 1 deletion companion/src/firmwares/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ namespace Board {
BOARD_FLYSKY_EL18,
BOARD_JUMPER_TPROV2,
BOARD_RADIOMASTER_POCKET,
BOARD_JUMPER_T20V2,
BOARD_TYPE_COUNT,
BOARD_TYPE_MAX = BOARD_TYPE_COUNT - 1
};
Expand Down Expand Up @@ -444,7 +445,7 @@ inline bool IS_JUMPER_T18(Board::Type board)

inline bool IS_JUMPER_T20(Board::Type board)
{
return board == Board::BOARD_JUMPER_T20;
return board == Board::BOARD_JUMPER_T20 || board == Board::BOARD_JUMPER_T20V2;
}

inline bool IS_RADIOMASTER_TX16S(Board::Type board)
Expand Down Expand Up @@ -492,6 +493,7 @@ inline bool IS_FAMILY_T12(Board::Type board)
{
return board == Board::BOARD_JUMPER_T12 ||
board == Board::BOARD_JUMPER_T20 ||
board == Board::BOARD_JUMPER_T20V2 ||
board == Board::BOARD_JUMPER_TLITE ||
board == Board::BOARD_JUMPER_TLITE_F4 ||
board == Board::BOARD_JUMPER_TPRO ||
Expand Down
9 changes: 9 additions & 0 deletions companion/src/firmwares/opentx/opentxinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ const char * OpenTxEepromInterface::getName()
return "EdgeTX for Jumper T18";
case BOARD_JUMPER_T20:
return "EdgeTX for Jumper T20";
case BOARD_JUMPER_T20V2:
return "EdgeTX for Jumper T20 V2";
case BOARD_RADIOMASTER_TX16S:
return "EdgeTX for Radiomaster TX16S";
case BOARD_RADIOMASTER_TX12:
Expand Down Expand Up @@ -1424,6 +1426,13 @@ void registerOpenTxFirmwares()
addOpenTxRfOptions(firmware, NONE);
registerOpenTxFirmware(firmware);

/* Jumper T20 V2 board */
firmware = new OpenTxFirmware(FIRMWAREID("t20v2"), Firmware::tr("Jumper T20 V2"), BOARD_JUMPER_T20V2);
addOpenTxFrskyOptions(firmware);
firmware->addOption("internalelrs", Firmware::tr("Select if internal ELRS module is installed"));
addOpenTxRfOptions(firmware, NONE);
registerOpenTxFirmware(firmware);

/* Radiomaster Boxer board */
firmware = new OpenTxFirmware(FIRMWAREID("boxer"), QCoreApplication::translate("Firmware", "Radiomaster Boxer"), Board::BOARD_RADIOMASTER_BOXER);
addOpenTxCommonOptions(firmware);
Expand Down
1 change: 1 addition & 0 deletions fw.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
["Jumper T-Pro V2", "tprov2-"],
["Jumper T20", "t20-"],
["Jumper T14", "t14-"],
["Jumper T20 V2", "t20v2-"],
["RadioMaster Boxer", "boxer-"],
["RadioMaster MT12","mt12-"],
["RadioMaster Pocket", "pocket-"],
Expand Down
2 changes: 1 addition & 1 deletion radio/src/datastructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static inline void check_struct()
#elif defined(RADIO_T14)
CHKSIZE(RadioData, 869);
CHKSIZE(ModelData, 6265);
#elif defined(RADIO_T20)
#elif defined(RADIO_FAMILY_T20)
CHKSIZE(RadioData, 869);
CHKSIZE(ModelData, 6326);
#elif defined(RADIO_BOXER)
Expand Down
8 changes: 4 additions & 4 deletions radio/src/gui/128x64/startup_shutdown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const unsigned char bmp_sleep[] = {
#include "sleep.lbm"
};

#if defined(RADIO_T20)
#if defined(RADIO_FAMILY_T20)
constexpr uint8_t steps = NUM_FUNCTIONS_SWITCHES/2;
#elif defined(FUNCTION_SWITCHES)
constexpr uint8_t steps = NUM_FUNCTIONS_SWITCHES;
Expand All @@ -53,7 +53,7 @@ void drawStartupAnimation(uint32_t duration, uint32_t totalDuration)
for (uint8_t j = 0; j < steps; j++) {
if (index2 > j) {
fsLedOn(j);
#if defined(RADIO_T20)
#if defined(RADIO_FAMILY_T20)
fsLedOn(j + steps);
#endif
}
Expand Down Expand Up @@ -89,12 +89,12 @@ void drawShutdownAnimation(uint32_t duration, uint32_t totalDuration,

for (uint8_t j = 0; j < steps; j++) {
fsLedOff(j);
#if defined(RADIO_T20)
#if defined(RADIO_FAMILY_T20)
fsLedOff(j + steps);
#endif
if (steps - index2 > j) {
fsLedOn(j);
#if defined(RADIO_T20)
#if defined(RADIO_FAMILY_T20)
fsLedOn(j + steps);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion radio/src/hal/rotary_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define ROTENC_MIDSPEED 5
#define ROTENC_HIGHSPEED 50

#if defined(RADIO_T20) || defined(RADIO_T14)
#if defined(RADIO_FAMILY_T20) || defined(RADIO_T14)
#define ROTARY_ENCODER_GRANULARITY 4
#else
#define ROTARY_ENCODER_GRANULARITY 2
Expand Down
2 changes: 1 addition & 1 deletion radio/src/storage/yaml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ elseif(PCB STREQUAL PL18)
elseif(PCB STREQUAL X7)
if(PCBREV STREQUAL TPRO)
set(YAML_GEN_OUTPUT storage/yaml/yaml_datastructs_tpro.cpp)
elseif(PCBREV STREQUAL T20)
elseif((PCBREV STREQUAL T20) OR (PCBREV STREQUAL T20V2))
set(YAML_GEN_OUTPUT storage/yaml/yaml_datastructs_t20.cpp)
else()
set(YAML_GEN_OUTPUT storage/yaml/yaml_datastructs_128x64.cpp)
Expand Down
2 changes: 1 addition & 1 deletion radio/src/storage/yaml/yaml_datastructs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#elif defined(PCBX7)
#if defined(RADIO_TPRO) || defined(RADIO_TPROV2)
#include "yaml_datastructs_tpro.cpp"
#elif defined(RADIO_T20)
#elif defined(RADIO_FAMILY_T20)
#include "yaml_datastructs_t20.cpp"
#else
#include "yaml_datastructs_128x64.cpp"
Expand Down
2 changes: 1 addition & 1 deletion radio/src/targets/common/arm/stm32/bootloader/boot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#define BOOTLOADER_KEYS 0x42
#endif

#if defined(RADIO_T20)
#if defined(RADIO_FAMILY_T20)
#define SECONDARY_BOOTLOADER_KEYS 0x1200
#endif

Expand Down
15 changes: 15 additions & 0 deletions radio/src/targets/taranis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,21 @@ elseif(PCB STREQUAL X7)
set(FLYSKY_GIMBAL ON)
add_definitions(-DFUNCTION_SWITCHES)
add_definitions(-DRADIO_T20)
add_definitions(-DRADIO_FAMILY_T20)
add_definitions(-DMANUFACTURER_JUMPER)
set(ENABLE_SERIAL_PASSTHROUGH ON CACHE BOOL "Enable serial passthrough")
elseif(PCBREV STREQUAL T20V2)
set(DEFAULT_INTERNAL_MODULE MULTIMODULE CACHE STRING "Default internal module")
set(INTERNAL_MODULE_SERIAL YES)
set(MODULE_SIZE_SML YES)
set(FLAVOUR t20v2)
set(NAVIGATION_TYPE x7)
set(ROTARY_ENCODER YES)
set(CPU_TYPE_FULL STM32F407xE)
set(FLYSKY_GIMBAL ON)
add_definitions(-DFUNCTION_SWITCHES)
add_definitions(-DRADIO_T20V2)
add_definitions(-DRADIO_FAMILY_T20)
add_definitions(-DMANUFACTURER_JUMPER)
set(ENABLE_SERIAL_PASSTHROUGH ON CACHE BOOL "Enable serial passthrough")
elseif(PCBREV STREQUAL TLITE)
Expand Down
6 changes: 3 additions & 3 deletions radio/src/targets/taranis/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ extern HardwareOptions hardwareOptions;
#define BATTERY_WARN 87 // 8.7V
#define BATTERY_MIN 85 // 8.5V
#define BATTERY_MAX 115 // 11.5V
#elif defined(PCBXLITE) || defined(RADIO_T20)
#elif defined(PCBXLITE) || defined(RADIO_FAMILY_T20)
// 2 x Li-Ion
#define BATTERY_WARN 66 // 6.6V
#define BATTERY_MIN 67 // 6.7V
Expand Down Expand Up @@ -416,13 +416,13 @@ void setTopBatteryValue(uint32_t volts);

#if defined(RADIO_ZORRO) || defined(RADIO_TX12MK2) || defined(RADIO_BOXER) || defined(RADIO_MT12) || defined(RADIO_POCKET)
#define VOLTAGE_DROP 45
#elif defined(RADIO_TPROV2) || defined(RADIO_T20)
#elif defined(RADIO_TPROV2) || defined(RADIO_FAMILY_T20)
#define VOLTAGE_DROP 60
#else
#define VOLTAGE_DROP 20
#endif

#if defined(RADIO_T20)
#if defined(RADIO_FAMILY_T20)
#define NUM_TRIMS 8
#else
#define NUM_TRIMS 4
Expand Down
Loading

0 comments on commit 84a90a7

Please sign in to comment.