Skip to content

Commit

Permalink
feat: support for RadioMaster GX12 (#5703)
Browse files Browse the repository at this point in the history
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
  • Loading branch information
4 people authored Dec 13, 2024
1 parent 0f86cd9 commit 36cdd93
Show file tree
Hide file tree
Showing 95 changed files with 2,284 additions and 602 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ body:
- Jumper T-Pro
- Jumper T-Pro V2
- RadioMaster Boxer
- RadioMaster GX12
- RadioMaster MT12
- RadioMaster Pocket
- RadioMaster T8
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
- xlite
- xlites
- mt12
- gx12
container:
image: ghcr.io/edgetx/edgetx-dev:latest
volumes:
Expand Down Expand Up @@ -103,7 +104,7 @@ jobs:
- t8;zorro;pocket;mt12;commando8
- tlite;tpro;tprov2;tpros;bumblebee;lr3pro
- t20;t20v2;t14
- tx12;tx12mk2;boxer
- tx12;tx12mk2;boxer;gx12
- tx16s
- f16
- v16
Expand All @@ -114,7 +115,7 @@ jobs:
- x9e;x9e-hall
- x9lite;x9lites
- xlite;xlites
- mt12
- mt12;gx12
container:
image: ghcr.io/edgetx/edgetx-dev:latest
volumes:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- t8;zorro;pocket;mt12;commando8
- tlite;tpro;tprov2;tpros;bumblebee;lr3pro
- t20;t20v2;t14
- tx12;tx12mk2;boxer
- tx12;tx12mk2;boxer;gx12
- tx16s
- f16
- v16
Expand All @@ -35,6 +35,7 @@ jobs:
- x9lite;x9lites
- xlite;xlites
- mt12
- gx12
container:
image: ghcr.io/edgetx/edgetx-dev:latest
volumes:
Expand Down
2 changes: 2 additions & 0 deletions companion/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ elseif(PCB STREQUAL X7 AND PCBREV STREQUAL ZORRO)
set(FLAVOUR zorro)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL BOXER)
set(FLAVOUR boxer)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL GX12)
set(FLAVOUR gx12)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL POCKET)
set(FLAVOUR pocket)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL LR3PRO)
Expand Down
6 changes: 6 additions & 0 deletions companion/src/firmwares/boards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ int Boards::getEEpromSize(Board::Type board)
case BOARD_RADIOMASTER_BOXER:
case BOARD_RADIOMASTER_POCKET:
case BOARD_RADIOMASTER_MT12:
case BOARD_RADIOMASTER_GX12:
return EESIZE_TARANIS;
case BOARD_UNKNOWN:
return EESIZE_MAX;
Expand Down Expand Up @@ -260,6 +261,7 @@ int Boards::getFlashSize(Type board)
case BOARD_RADIOMASTER_T8:
case BOARD_RADIOMASTER_POCKET:
case BOARD_RADIOMASTER_MT12:
case BOARD_RADIOMASTER_GX12:
return FSIZE_TARANIS;
case BOARD_HORUS_X12S:
case BOARD_X10:
Expand Down Expand Up @@ -620,6 +622,8 @@ QString Boards::getBoardName(Board::Type board)
return "Radiomaster TX16S";
case BOARD_RADIOMASTER_ZORRO:
return "Radiomaster Zorro";
case BOARD_RADIOMASTER_GX12:
return "Radiomaster GX12";
case BOARD_FLYSKY_NV14:
return "FlySky NV14";
case BOARD_FLYSKY_EL18:
Expand Down Expand Up @@ -744,6 +748,7 @@ int Boards::getDefaultInternalModules(Board::Type board)
case BOARD_RADIOMASTER_BOXER:
case BOARD_RADIOMASTER_MT12:
case BOARD_RADIOMASTER_POCKET:
case BOARD_RADIOMASTER_GX12:
case BOARD_RADIOMASTER_TX12_MK2:
case BOARD_IFLIGHT_COMMANDO8:
case BOARD_JUMPER_T12MAX:
Expand Down Expand Up @@ -786,6 +791,7 @@ void Boards::getBattRange(Board::Type board, int& vmin, int& vmax, unsigned int&
case BOARD_RADIOMASTER_POCKET:
case BOARD_RADIOMASTER_ZORRO:
case BOARD_RADIOMASTER_MT12:
case BOARD_RADIOMASTER_GX12:
case BOARD_JUMPER_T12:
case BOARD_JUMPER_T14:
case BOARD_JUMPER_TPRO:
Expand Down
7 changes: 7 additions & 0 deletions companion/src/firmwares/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ namespace Board {
BOARD_RADIOMASTER_TX12,
BOARD_RADIOMASTER_TX12_MK2,
BOARD_RADIOMASTER_BOXER,
BOARD_RADIOMASTER_GX12,
BOARD_RADIOMASTER_T8,
BOARD_JUMPER_TLITE,
BOARD_JUMPER_TLITE_F4,
Expand Down Expand Up @@ -590,6 +591,11 @@ inline bool IS_RADIOMASTER_POCKET(Board::Type board)
return board == Board::BOARD_RADIOMASTER_POCKET;
}

inline bool IS_RADIOMASTER_GX12(Board::Type board)
{
return board == Board::BOARD_RADIOMASTER_GX12;
}

inline bool IS_RADIOMASTER_T8(Board::Type board)
{
return board == Board::BOARD_RADIOMASTER_T8;
Expand Down Expand Up @@ -629,6 +635,7 @@ inline bool IS_FAMILY_T12(Board::Type board)
board == Board::BOARD_RADIOMASTER_BOXER ||
board == Board::BOARD_RADIOMASTER_MT12 ||
board == Board::BOARD_RADIOMASTER_POCKET ||
board == Board::BOARD_RADIOMASTER_GX12 ||
board == Board::BOARD_RADIOMASTER_T8 ||
board == Board::BOARD_BETAFPV_LR3PRO ||
board == Board::BOARD_IFLIGHT_COMMANDO8;
Expand Down
7 changes: 7 additions & 0 deletions companion/src/firmwares/opentx/opentxinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,13 @@ void registerOpenTxFirmwares()
registerOpenTxFirmware(firmware);
addOpenTxRfOptions(firmware, FLEX);

/* Radiomaster GX12 board */
firmware = new OpenTxFirmware(FIRMWAREID("gx12"), QCoreApplication::translate("Firmware", "Radiomaster GX12"), BOARD_RADIOMASTER_GX12);
addOpenTxCommonOptions(firmware);
addOpenTxFontOptions(firmware);
registerOpenTxFirmware(firmware);
addOpenTxRfOptions(firmware, FLEX);

/* Radiomaster TX16S board */
firmware = new OpenTxFirmware(FIRMWAREID("tx16s"), Firmware::tr("Radiomaster TX16S / SE / Hall / Masterfire"), BOARD_RADIOMASTER_TX16S);
addOpenTxFrskyOptions(firmware);
Expand Down
3 changes: 3 additions & 0 deletions companion/src/simulation/simulatorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato
case Board::BOARD_RADIOMASTER_MT12:
radioUiWidget = new SimulatedUIWidgetMT12(simulator, this);
break;
case Board::BOARD_RADIOMASTER_GX12:
radioUiWidget = new SimulatedUIWidgetGeneric(simulator, this);
break;
case Board::BOARD_RADIOMASTER_T8:
radioUiWidget = new SimulatedUIWidgetT8(simulator, this);
break;
Expand Down
3 changes: 2 additions & 1 deletion fw.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
["RadioMaster TX12", "tx12-"],
["RadioMaster TX12MK2", "tx12mk2-"],
["RadioMaster TX16S", "tx16s-"],
["RadioMaster Zorro","zorro-"]
["RadioMaster Zorro","zorro-"],
["RadioMaster GX12", "gx12-"]
],
"changelog": "- Major initial bug fixes"
}
10 changes: 10 additions & 0 deletions radio/src/boards/generic_stm32/rgb_leds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ void rgbSetLedColor(uint8_t led, uint8_t r, uint8_t g, uint8_t b)
#endif
}

uint32_t rgbGetLedColor(uint8_t led)
{
return ws2812_get_color(led);
}

bool rgbGetState(uint8_t led)
{
return ws2812_get_state(led);
}

void rgbLedColorApply()
{
ws2812_update(&_led_timer);;
Expand Down
2 changes: 2 additions & 0 deletions radio/src/boards/generic_stm32/rgb_leds.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@
void rgbLedStart();
void rgbLedStop();
void rgbSetLedColor(unsigned char, unsigned char, unsigned char, unsigned char);
uint32_t rgbGetLedColor(uint8_t led);
bool rgbGetState(unsigned char);
void rgbLedColorApply();
4 changes: 2 additions & 2 deletions radio/src/boards/generic_stm32/switches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@

#include <stdlib.h>

void boardInitSwitches()
__weak void boardInitSwitches()
{
_init_switches();
}

SwitchHwPos boardSwitchGetPosition(uint8_t cat, uint8_t idx)
__weak SwitchHwPos boardSwitchGetPosition(uint8_t cat, uint8_t idx)
{
return stm32_switch_get_position(&_switch_offsets[cat][idx]);
}
Expand Down
Loading

0 comments on commit 36cdd93

Please sign in to comment.