Skip to content

Commit

Permalink
feat: Fatfish F16 support (2.10) (#5222)
Browse files Browse the repository at this point in the history
Co-authored-by: Richard Li <[email protected]>
  • Loading branch information
pfeerick and richardclli authored Jun 30, 2024
1 parent aff7987 commit 252d10e
Show file tree
Hide file tree
Showing 73 changed files with 650 additions and 47 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 @@ -88,6 +88,7 @@ body:
options:
- BetaFPV LiteRadio3 Pro
- iFlight Commando8
- Fatfish F16
- Flysky EL18
- Flysky NV14
- Flysky PL18/PL18EV
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ jobs:
- t20;t20v2;t14
- tx12;tx12mk2;boxer
- tx16s
- f16
- x10;x10-access
- x12s
- x7;x7-access
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- t20;t20v2;t14
- tx12;tx12mk2;boxer
- tx16s
- f16
- x10;x10-access
- x12s
- x7;x7-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 @@ -334,6 +334,8 @@ elseif(PCB STREQUAL X10 AND PCBREV STREQUAL EXPRESS)
set(FLAVOUR x10express)
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL TX16S)
set(FLAVOUR tx16s)
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL F16)
set(FLAVOUR f16)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL T14)
set(FLAVOUR t14)
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL T15)
Expand Down
4 changes: 4 additions & 0 deletions companion/src/companion.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@
<file>images/simulator/T8/right-dn.png</file>
<file>images/simulator/T8/bottom.png</file>
<file>images/simulator/T8/top.png</file>
<file>images/simulator/Fatfish/F16/left.png</file>
<file>images/simulator/Fatfish/F16/right.png</file>
<file>images/simulator/Fatfish/F16/top.png</file>
<file>images/simulator/Fatfish/F16/bottom.png</file>
<file>images/simulator/JumperT14/bottom.png</file>
<file>images/simulator/JumperT14/left.png</file>
<file>images/simulator/JumperT14/right.png</file>
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 @@ -210,6 +210,7 @@ int Boards::getEEpromSize(Board::Type board)
case BOARD_FLYSKY_NV14:
case BOARD_FLYSKY_EL18:
case BOARD_FLYSKY_PL18:
case BOARD_FATFISH_F16:
return 0;
default:
return 0;
Expand Down Expand Up @@ -261,6 +262,7 @@ int Boards::getFlashSize(Type board)
case BOARD_FLYSKY_NV14:
case BOARD_FLYSKY_EL18:
case BOARD_FLYSKY_PL18:
case BOARD_FATFISH_F16:
return FSIZE_HORUS;
case BOARD_UNKNOWN:
return FSIZE_MAX;
Expand Down Expand Up @@ -569,6 +571,8 @@ QString Boards::getBoardName(Board::Type board)
return "BETAFPV LR3PRO";
case BOARD_IFLIGHT_COMMANDO8:
return "iFlight Commando 8";
case BOARD_FATFISH_F16:
return "Fatfish F16";
default:
return CPN_STR_UNKNOWN_ITEM;
}
Expand Down Expand Up @@ -676,6 +680,7 @@ int Boards::getDefaultInternalModules(Board::Type board)
case BOARD_JUMPER_T20:
case BOARD_JUMPER_T20V2:
case BOARD_JUMPER_T15:
case BOARD_FATFISH_F16:
return (int)MODULE_TYPE_CROSSFIRE;

case BOARD_FLYSKY_NV14:
Expand Down
9 changes: 7 additions & 2 deletions companion/src/firmwares/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ namespace Board {
BOARD_JUMPER_TPROV2,
BOARD_RADIOMASTER_POCKET,
BOARD_JUMPER_T20V2,
BOARD_FATFISH_F16,
BOARD_TYPE_COUNT,
BOARD_TYPE_MAX = BOARD_TYPE_COUNT - 1
};
Expand Down Expand Up @@ -492,15 +493,19 @@ inline bool IS_RADIOMASTER_POCKET(Board::Type board)
return board == Board::BOARD_RADIOMASTER_POCKET;
}


inline bool IS_RADIOMASTER_T8(Board::Type board)
{
return board == Board::BOARD_RADIOMASTER_T8;
}

inline bool IS_FATFISH_F16(Board::Type board)
{
return board == Board::BOARD_FATFISH_F16;
}

inline bool IS_FAMILY_T16(Board::Type board)
{
return board == Board::BOARD_JUMPER_T15 || board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_RADIOMASTER_TX16S || board == Board::BOARD_JUMPER_T18;
return board == Board::BOARD_JUMPER_T15 || board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_RADIOMASTER_TX16S || board == Board::BOARD_JUMPER_T18 || board == Board::BOARD_FATFISH_F16;
}

inline bool IS_FAMILY_T12(Board::Type board)
Expand Down
7 changes: 5 additions & 2 deletions companion/src/firmwares/customfunctiondata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ QString CustomFunctionData::funcToString(const AssignFunc func, const ModelData
return tr("Audio Amp Off");
else if (func == FuncRGBLed)
return tr("RGB leds");
else if (func == FuncLCDtoVideo)
return tr("LCD to Video");
else {
return QString(CPN_STR_UNKNOWN_ITEM);
}
Expand Down Expand Up @@ -253,9 +255,10 @@ bool CustomFunctionData::isFuncAvailable(const int index, const ModelData * mode
((index >= FuncRangeCheckInternalModule && index <= FuncBindExternalModule) && !fw->getCapability(DangerousFunctions)) ||
((index >= FuncAdjustGV1 && index <= FuncAdjustGVLast) && !fw->getCapability(Gvars)) ||
((index == FuncDisableTouch) && !IS_HORUS_OR_TARANIS(fw->getBoard())) ||
((index == FuncSetScreen && !Boards::getCapability(fw->getBoard(), Board::HasColorLcd)) ||
((index == FuncSetScreen && !Boards::getCapability(fw->getBoard(), Board::HasColorLcd))) ||
((index == FuncDisableAudioAmp && !Boards::getCapability(fw->getBoard(), Board::HasAudioMuteGPIO))) ||
((index == FuncRGBLed && !Boards::getCapability(fw->getBoard(), Board::HasLedStripGPIO))))
((index == FuncRGBLed && !Boards::getCapability(fw->getBoard(), Board::HasLedStripGPIO))) ||
((index == FuncLCDtoVideo && !IS_FATFISH_F16(fw->getBoard())))
);
return !ret;
}
Expand Down
1 change: 1 addition & 0 deletions companion/src/firmwares/customfunctiondata.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ enum AssignFunc {
FuncSetScreen,
FuncDisableAudioAmp,
FuncRGBLed,
FuncLCDtoVideo,
FuncCount,
FuncReserve = -1
};
Expand Down
1 change: 1 addition & 0 deletions companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ static const YamlLookupTable customFnLut = {
{ FuncSetScreen, "SET_SCREEN"},
{ FuncDisableAudioAmp, "DISABLE_AUDIO_AMP" },
{ FuncRGBLed, "RGB_LED" },
{ FuncLCDtoVideo, "LCD_TO_VIDEO" },
};

static const YamlLookupTable trainerLut = {
Expand Down
1 change: 1 addition & 0 deletions companion/src/firmwares/opentx/opentxeeprom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1642,6 +1642,7 @@ class CustomFunctionsConversionTable: public ConversionTable {
addConversion(FuncRacingMode, val++);
addConversion(FuncDisableTouch, val++);
addConversion(FuncSetScreen, val++);
addConversion(FuncLCDtoVideo, val++);
}
}
};
Expand Down
25 changes: 18 additions & 7 deletions companion/src/firmwares/opentx/opentxinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ const char * OpenTxEepromInterface::getName()
return "EdgeTx for BETAFPV LR3PRO";
case BOARD_IFLIGHT_COMMANDO8:
return "EdgeTX for iFlight Commando 8";
case BOARD_FATFISH_F16:
return "EdgeTX for Fatfish F16";
default:
return "Board is unknown to EdgeTX";
}
Expand Down Expand Up @@ -1254,6 +1256,9 @@ void registerOpenTxFirmwares()
{
OpenTxFirmware * firmware;

static const Firmware::Option opt_bt("bluetooth", Firmware::tr("Support for bluetooth module"));
static const Firmware::Option opt_internal_gps("internalgps", Firmware::tr("Support internal GPS"));

/* BETAFPV LR3PRO board */
firmware = new OpenTxFirmware(FIRMWAREID("lr3pro"), QCoreApplication::translate("Firmware", "BETAFPV LiteRadio3 Pro"), BOARD_BETAFPV_LR3PRO);
addOpenTxCommonOptions(firmware);
Expand All @@ -1264,24 +1269,32 @@ void registerOpenTxFirmwares()
registerOpenTxFirmware(firmware);
addOpenTxRfOptions(firmware, FLEX);

/* Fatfish F16 board */
firmware = new OpenTxFirmware(FIRMWAREID("f16"), Firmware::tr("Fatfish F16"), BOARD_FATFISH_F16);
addOpenTxFrskyOptions(firmware);
addOpenTxRfOptions(firmware, FLEX);
firmware->addOptionsGroup({opt_bt, opt_internal_gps});
firmware->addOption("flyskygimbals", Firmware::tr("Support hardware mod: FlySky Paladin EV Gimbals"));
registerOpenTxFirmware(firmware);

/* FlySky NV14 board */
firmware = new OpenTxFirmware(FIRMWAREID("nv14"), QCoreApplication::translate("Firmware", "FlySky NV14"), BOARD_FLYSKY_NV14);
addOpenTxFrskyOptions(firmware);
firmware->addOption("bluetooth", Firmware::tr("Support for bluetooth module"));
firmware->addOption(opt_bt);
addOpenTxRfOptions(firmware, FLEX + AFHDS2A + AFHDS3);
registerOpenTxFirmware(firmware);

/* FlySky EL18 board */
firmware = new OpenTxFirmware(FIRMWAREID("el18"), QCoreApplication::translate("Firmware", "FlySky EL18"), BOARD_FLYSKY_EL18);
addOpenTxFrskyOptions(firmware);
firmware->addOption("bluetooth", Firmware::tr("Support for bluetooth module"));
firmware->addOption(opt_bt);
addOpenTxRfOptions(firmware, FLEX + AFHDS2A + AFHDS3);
registerOpenTxFirmware(firmware);

/* FlySky PL18 board */
firmware = new OpenTxFirmware(FIRMWAREID("pl18"), Firmware::tr("FlySky PL18"), BOARD_FLYSKY_PL18);
addOpenTxFrskyOptions(firmware);
firmware->addOption("bluetooth", Firmware::tr("Support for bluetooth module"));
firmware->addOption(opt_bt);
addOpenTxRfOptions(firmware, FLEX + AFHDS3);
registerOpenTxFirmware(firmware);

Expand Down Expand Up @@ -1453,14 +1466,14 @@ void registerOpenTxFirmwares()
firmware = new OpenTxFirmware(FIRMWAREID("t16"), Firmware::tr("Jumper T16 / T16+ / T16 Pro"), BOARD_JUMPER_T16);
addOpenTxFrskyOptions(firmware);
firmware->addOption("internalmulti", Firmware::tr("Support for MULTI internal module"));
firmware->addOption("bluetooth", Firmware::tr("Support for bluetooth module"));
firmware->addOption(opt_bt);
addOpenTxRfOptions(firmware, FLEX);
registerOpenTxFirmware(firmware);

/* Jumper T18 board */
firmware = new OpenTxFirmware(FIRMWAREID("t18"), Firmware::tr("Jumper T18"), BOARD_JUMPER_T18);
addOpenTxFrskyOptions(firmware);
firmware->addOption("bluetooth", Firmware::tr("Support for bluetooth module"));
firmware->addOption(opt_bt);
registerOpenTxFirmware(firmware);
addOpenTxRfOptions(firmware, FLEX);

Expand Down Expand Up @@ -1533,8 +1546,6 @@ void registerOpenTxFirmwares()
firmware = new OpenTxFirmware(FIRMWAREID("tx16s"), Firmware::tr("Radiomaster TX16S / SE / Hall / Masterfire"), BOARD_RADIOMASTER_TX16S);
addOpenTxFrskyOptions(firmware);
addOpenTxRfOptions(firmware, FLEX);
static const Firmware::Option opt_bt("bluetooth", Firmware::tr("Support for bluetooth module"));
static const Firmware::Option opt_internal_gps("internalgps", Firmware::tr("Support internal GPS"));
firmware->addOptionsGroup({opt_bt, opt_internal_gps});
firmware->addOption("flyskygimbals", Firmware::tr("Support hardware mod: FlySky Paladin EV Gimbals"));
registerOpenTxFirmware(firmware);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions companion/src/simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ set(${PROJECT_NAME}_SRCS
simulateduiwidgetBoxer.cpp
simulateduiwidgetCommando8.cpp
simulateduiwidgetEL18.cpp
simulateduiwidgetFatfishF16.cpp
simulateduiwidgetJumperT12.cpp
simulateduiwidgetJumperT14.cpp
simulateduiwidgetJumperT15.cpp
Expand Down
21 changes: 17 additions & 4 deletions companion/src/simulation/simulateduiwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ namespace Ui {
class SimulatedUIWidgetBoxer;
class SimulatedUIWidgetPocket;
class SimulatedUIWidgetT8;
class SimulatedUIWidgetFatfishF16;
class SimulatedUIWidgetNV14;
class SimulatedUIWidgetEL18;
class SimulatedUIWidgetPL18;
Expand Down Expand Up @@ -376,6 +377,18 @@ class SimulatedUIWidgetTX12: public SimulatedUIWidget
Ui::SimulatedUIWidgetTX12 * ui;
};

class SimulatedUIWidgetTX16S: public SimulatedUIWidget
{
Q_OBJECT

public:
explicit SimulatedUIWidgetTX16S(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetTX16S();

private:
Ui::SimulatedUIWidgetTX16S * ui;
};

class SimulatedUIWidgetZorro: public SimulatedUIWidget
{
Q_OBJECT
Expand Down Expand Up @@ -424,16 +437,16 @@ Q_OBJECT
Ui::SimulatedUIWidgetT8 * ui;
};

class SimulatedUIWidgetTX16S: public SimulatedUIWidget
class SimulatedUIWidgetFatfishF16: public SimulatedUIWidget
{
Q_OBJECT

public:
explicit SimulatedUIWidgetTX16S(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetTX16S();
explicit SimulatedUIWidgetFatfishF16(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetFatfishF16();

private:
Ui::SimulatedUIWidgetTX16S * ui;
Ui::SimulatedUIWidgetFatfishF16 * ui;
};

class SimulatedUIWidgetNV14: public SimulatedUIWidget
Expand Down
70 changes: 70 additions & 0 deletions companion/src/simulation/simulateduiwidgetFatfishF16.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright (C) EdgeTX
*
* Based on code named
* opentx - https://github.com/opentx/opentx
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/


#include "simulateduiwidget.h"
#include "ui_simulateduiwidgetFatfishF16.h"

SimulatedUIWidgetFatfishF16::SimulatedUIWidgetFatfishF16(SimulatorInterface *simulator, QWidget * parent):
SimulatedUIWidget(simulator, parent),
ui(new Ui::SimulatedUIWidgetFatfishF16)
{
RadioUiAction * act;

ui->setupUi(this);

// add actions in order of appearance on the help menu

act = new RadioUiAction(14, QList<int>() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS);
addRadioWidget(ui->leftbuttons->addArea(QRect(60, 10, 90, 50), "Fatfish/F16/left.png", act));

act = new RadioUiAction(12, QList<int>() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL);
addRadioWidget(ui->leftbuttons->addArea(QRect(75, 107, 80, 30), "Fatfish/F16/left.png", act));

act = new RadioUiAction(5, QList<int>() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN);
addRadioWidget(ui->leftbuttons->addArea(QRect(75, 172, 80, 30), "Fatfish/F16/left.png", act));

act = new RadioUiAction(4, QList<int>() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP);
addRadioWidget(ui->leftbuttons->addArea(QRect(75, 237, 80, 30), "Fatfish/F16/left.png", act));

act = new RadioUiAction(13, QList<int>() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE);
addRadioWidget(ui->leftbuttons->addArea(QRect(75, 302, 80, 30), "Fatfish/F16/left.png", act));

m_mouseMidClickAction = new RadioUiAction(2, QList<int>() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN);
addRadioWidget(ui->rightbuttons->addArea(QRect(45, 170, 65, 125), "Fatfish/F16/right.png", m_mouseMidClickAction));

act = new RadioUiAction(1, QList<int>() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace,
SIMU_STR_HLP_KEY_DN % "<br>" % SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_RTN);
addRadioWidget(ui->rightbuttons->addArea(QRect(50, 10, 90, 50), "Fatfish/F16/right.png", act));

m_scrollUpAction = new RadioUiAction(-1, QList<int>() << Qt::Key_Minus, SIMU_STR_HLP_KEY_MIN % "|" % SIMU_STR_HLP_MOUSE_UP, SIMU_STR_HLP_ACT_ROT_LFT);
m_scrollDnAction = new RadioUiAction(-1, QList<int>() << Qt::Key_Plus << Qt::Key_Equal, SIMU_STR_HLP_KEY_PLS % "|" % SIMU_STR_HLP_MOUSE_DN, SIMU_STR_HLP_ACT_ROT_RGT);
connectScrollActions();

m_backlightColors << QColor(47, 123, 227);

setLcd(ui->lcd);
}

SimulatedUIWidgetFatfishF16::~SimulatedUIWidgetFatfishF16()
{
delete ui;
}
Loading

0 comments on commit 252d10e

Please sign in to comment.