Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Flysky PL18 Support #3963

Closed
wants to merge 99 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
ebe394c
Prepare for Virtual File System.
richardclli Aug 23, 2023
e6ca66c
Virtual file system
gagarinlg Dec 26, 2021
d43996c
Fix paths in unit tests
raphaelcoeffic Jan 5, 2023
9505e78
dynamically alloc memory for file in lua file api
gagarinlg Jan 5, 2023
9873ab7
fix compiler warnings
gagarinlg Jan 5, 2023
db20324
chore: more compiler warning fixes
gagarinlg Jan 5, 2023
c0582ec
remove LittleFS compat code, change VirtualFS API to use const char* …
gagarinlg Jan 20, 2023
0f796d5
use only char* and const char* for VirtualFS to save space
gagarinlg Jan 21, 2023
6956306
fix storing compiled lua scripts
gagarinlg Jan 22, 2023
df04c59
fix B&W bootloader
gagarinlg Jan 22, 2023
4081613
Fixed problematic fprintf that will output garbage characters.
richardclli Jul 18, 2023
00f29a2
Added flash chip MX25L256.
richardclli May 11, 2023
8a32dac
Fine tuned the tjftl init parameters to balance between wearing, over…
richardclli Jun 17, 2023
df201e7
remove dependencies to FatFS.
richardclli May 19, 2023
dba7056
remove file system api dependencies, added file system compat layer v…
richardclli May 19, 2023
e26fc19
removed now unused libopenui_file
richardclli May 19, 2023
39f23bd
update example conf
richardclli May 19, 2023
f725c63
disable file access when used in bootloader (should be in libopenui_c…
richardclli May 19, 2023
b1bc83b
libopenui changes to sync with VirtualFS changes
richardclli May 19, 2023
654892c
Fixed system audio problem.
richardclli Jun 27, 2023
3dc492f
Clean up string usage to save memory.
richardclli Aug 21, 2023
103c2c5
Updated FTL implementation to FrFTL.
richardclli Aug 16, 2023
97ee6c7
Enable SPI flash by default for NV14/EL18.
richardclli Aug 23, 2023
883d0b6
Fixed some more problems for EL18 using internal SPI flash.
richardclli Aug 23, 2023
8c3ded8
Fixed problems after rebase.
richardclli Aug 24, 2023
f6aa7a0
Initial rough target for FlySky PL18, based off NV14 target.
rotorman Dec 26, 2021
f6c31ac
Added CST340 touch controller to support PL18/PL18EV.
rotorman Dec 28, 2021
7d4c4be
Typofix (parenthesis).
rotorman Dec 28, 2021
58e5ec2
Touch coordinates need to be inverted horizontally and vertically.
rotorman Dec 28, 2021
afa7a9e
Enable touch button on calib screen (bugfix).
rotorman Dec 29, 2021
afb9553
Check CST340 presence and read out firmware version and display it on…
rotorman Dec 29, 2021
e308844
Better to read CST340 once at init to clear internal CST340 status.
rotorman Dec 29, 2021
9439591
Change to analog audio output at PA4 DAC0.
rotorman Jan 4, 2022
8fc8328
Analog audio is working, changed SD card to work with 1 bit mode (eas…
rotorman Jan 6, 2022
32b97fc
Main battery and RTC coin cell voltage sampling works.
rotorman Jan 8, 2022
61afdfd
Pots VRA to VRC function.
rotorman Jan 9, 2022
aac9e20
Matched PL18EV switch types.
rotorman Jan 9, 2022
3d4e156
PL18 side sliders are now working, started work on trims.
rotorman Jan 9, 2022
271fd42
Switches A to H work now.
rotorman Jan 9, 2022
a0e7910
Extension to 8 trims to support FlySky PL18/PL18EV.
rotorman Jan 10, 2022
115ede1
Generate YAML struct for PL18
raphaelcoeffic Jan 10, 2022
1a94c9f
Correct trims mapping.
rotorman Jan 10, 2022
427a30d
Adds trims TR1 and TR4 as mixer sources (TR5 to TR8 are for the sticks).
rotorman Jan 10, 2022
5dfbb25
Avoid concurrent key matrix agitation from multiple tasks.
rotorman Jan 10, 2022
edc419e
TR3 and TR4 trims as buttons for bootloader.
rotorman Jan 11, 2022
b0ca8cf
Removed PL18 internal module (remnants of NV14 code) and freeing up U…
rotorman Jan 11, 2022
2d3941e
Side sliders of PL18 are called VRD and VRE not LS and RS.
rotorman Jan 11, 2022
97bcc2f
Initial steps towards stick pot controls and battery charger(s). I/O …
rotorman Jan 12, 2022
757a125
USB detection workaround for PL18
gagarinlg Feb 11, 2022
2d06194
PL18 reset battery charge screen timeout only on touch end
gagarinlg Feb 11, 2022
af0b9e2
rebase fs_pl18 branch to lvgl branch
gagarinlg Feb 13, 2022
9a47183
fix PL18 display orientation
gagarinlg Feb 13, 2022
0126445
fix touch calculcation
gagarinlg Feb 13, 2022
79a9b77
charging display adapted to horizontal screen
gagarinlg Feb 19, 2022
61e6a04
fix PL18 compilation after rebase
gagarinlg Feb 21, 2022
c7c35b4
fix simu crash for PL18
gagarinlg Feb 22, 2022
d7228db
remove old truetype fonts reference
gagarinlg Feb 22, 2022
cf5e492
work around for garbled screen
gagarinlg Feb 24, 2022
3c29194
ran the YAML generator on PL18
rotorman Feb 24, 2022
6bebe30
fix PL18 screen flickering
gagarinlg Feb 24, 2022
39242e8
workaround for lvgl button problem in radio_calibration
gagarinlg Feb 24, 2022
a36540d
workaround for PL18, disable hardware keys in ghost
gagarinlg Mar 5, 2022
4c51311
480x320 pixel splash screens for PL18/PL18EV
rotorman Mar 7, 2022
fb657b8
fix main view with three pots
gagarinlg Apr 3, 2022
73b93ce
fix compilation after rebase
gagarinlg Apr 3, 2022
a629da5
add missing typedef
gagarinlg Apr 13, 2022
876d463
fix pl18 simu compilation
gagarinlg Apr 13, 2022
5288feb
fix PL18 simu lcd
gagarinlg Apr 13, 2022
ccd2c5d
adapt to changes from main
gagarinlg Jun 12, 2022
25f881c
repair simu after rebase
gagarinlg Jun 12, 2022
abb803d
merge fixes
gagarinlg Jun 26, 2022
ad22d5f
support another touch controller on POL18, CST340 broken for now
gagarinlg Jun 26, 2022
dbd17c3
add support for another LCD version for PL18
gagarinlg Jun 26, 2022
45489b6
fix(PL18): black screen after wake up
gagarinlg Jun 29, 2022
7f012e9
support for both known touch controllers in PL18, files need to be re…
gagarinlg Jun 29, 2022
3760db4
PL18: use correct LCD pixel clock, display detection is broken
gagarinlg Jun 29, 2022
7950bef
detect HX.. display
gagarinlg Jun 30, 2022
8875ef8
fix(pl18): input edit screen
gagarinlg Nov 14, 2022
1a9c504
add PL18 to prepare script
gagarinlg Apr 1, 2022
c616b6d
PL18: fix LCD issues
gagarinlg Jul 1, 2022
8454520
Fix PL18/HX8357D bootloader init prob
rotorman Jul 17, 2022
6a88ab2
Fixed PL18 external module signal inversion.
richardclli Nov 1, 2022
f389718
Removed redundant init of PWR pin.
richardclli Nov 2, 2022
e45034f
Fixed broken icons in PL18 bootloader.
richardclli Nov 20, 2022
142a67e
Implemented wireless charging.
richardclli Jan 2, 2023
f8138f8
Updated telemetry driver, ELRS can now achieve 5.25M BAUD.
richardclli Jan 6, 2023
b33c228
Fixed YAML loading problem after rebase.
richardclli Apr 27, 2023
725b1c5
Added support for FRM303.
richardclli Dec 16, 2022
607da23
Fixed MPM module.
richardclli Apr 30, 2023
6859beb
Fixed PL18 yaml definition.
richardclli May 18, 2023
66236ae
Updated charging and power cycles.
richardclli May 20, 2023
3ce7f51
Fixed errors in debug build.
richardclli May 23, 2023
9bcdf15
PL18 do not have specialized telemetry.
richardclli May 25, 2023
f47e0da
Fixed key bindings with new virtual keys construct.
richardclli May 29, 2023
2dc71a9
Added internal MPM support via UART7.
richardclli Jun 10, 2023
a5ae397
Fixed INT module power control and keys init pins.
richardclli Jun 17, 2023
8fda011
Added internal module on/off definitions.
richardclli Jun 21, 2023
18e3615
Updated YAML definition.
richardclli Jul 12, 2023
cafeb87
Fixed some PL18 problems.
richardclli Aug 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
matrix:
target:
- nv14
- pl18
- t12
- t16
- t18
Expand Down Expand Up @@ -93,6 +94,7 @@ jobs:
matrix:
target:
- nv14
- pl18
- t12
- t16
- t18
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
matrix:
target:
- nv14
- pl18
- t12
- t16
- t18
Expand Down
2 changes: 0 additions & 2 deletions cmake.sh

This file was deleted.

44 changes: 39 additions & 5 deletions companion/src/firmwares/boards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ uint32_t Boards::getFourCC(Type board)
return 0x4378746F;
case BOARD_FLYSKY_NV14:
return 0x3A78746F;
case BOARD_FLYSKY_PL18:
return 0x4878746F;
default:
return 0;
}
Expand Down Expand Up @@ -153,6 +155,7 @@ int Boards::getEEpromSize(Board::Type board)
case BOARD_JUMPER_T18:
case BOARD_RADIOMASTER_TX16S:
case BOARD_FLYSKY_NV14:
case BOARD_FLYSKY_PL18:
return 0;
default:
return 0;
Expand Down Expand Up @@ -196,6 +199,7 @@ int Boards::getFlashSize(Type board)
case BOARD_JUMPER_T18:
case BOARD_RADIOMASTER_TX16S:
case BOARD_FLYSKY_NV14:
case BOARD_FLYSKY_PL18:
return FSIZE_HORUS;
case BOARD_UNKNOWN:
return FSIZE_MAX;
Expand Down Expand Up @@ -356,6 +360,20 @@ SwitchInfo Boards::getSwitchInfo(Board::Type board, int index)
if (index < DIM(switches))
return switches[index];
}
else if (IS_FLYSKY_PL18(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_2POS, "SA"},
{SWITCH_3POS, "SB"},
{SWITCH_2POS, "SC"},
{SWITCH_3POS, "SD"},
{SWITCH_3POS, "SE"},
{SWITCH_2POS, "SF"},
{SWITCH_3POS, "SG"},
{SWITCH_3POS, "SH"}
};
if (index < DIM(switches))
return switches[index];
}
else if (IS_FAMILY_HORUS_OR_T16(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "SA"},
Expand Down Expand Up @@ -436,6 +454,8 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
return 3;
else if (IS_FLYSKY_NV14(board))
return 2;
else if (IS_FLYSKY_PL18(board))
return 3;
else
return 3;

Expand All @@ -448,7 +468,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
case Sliders:
if (IS_HORUS_X12S(board) || IS_TARANIS_X9E(board))
return 4;
else if (IS_TARANIS_X9D(board) || IS_HORUS_X10(board) || IS_FAMILY_T16(board))
else if (IS_TARANIS_X9D(board) || IS_HORUS_X10(board) || IS_FAMILY_T16(board) || IS_FLYSKY_PL18(board))
return 2;
else
return 0;
Expand All @@ -469,7 +489,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
return getCapability(board, Board::Sticks) + getCapability(board, Board::Pots) + getCapability(board, Board::Sliders) + getCapability(board, Board::MouseAnalogs) + getCapability(board, Board::GyroAnalogs);

case MultiposPots:
if (IS_HORUS_OR_TARANIS(board) && !IS_FLYSKY_NV14(board))
if (IS_HORUS_OR_TARANIS(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board))
return getCapability(board, Board::Pots);
else
return 0;
Expand All @@ -494,6 +514,8 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
return 4;
else if (board == BOARD_FLYSKY_NV14)
return 8;
else if (board == BOARD_FLYSKY_PL18)
return 8;
else if (board == BOARD_RADIOMASTER_TX12_MK2 || board == BOARD_RADIOMASTER_BOXER)
return 6;
else if (IS_FAMILY_T12(board))
Expand Down Expand Up @@ -527,7 +549,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
return getCapability(board, Board::Switches);

case SwitchPositions:
if (IS_HORUS_OR_TARANIS(board) || IS_FLYSKY_NV14(board))
if (IS_HORUS_OR_TARANIS(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board))
return getCapability(board, Board::Switches) * 3;
else
return 9;
Expand All @@ -537,7 +559,9 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)


case NumTrims:
if (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board))
if (IS_FLYSKY_PL18(board))
return 8;
else if (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board))
return 6;
else if (IS_IFLIGHT_COMMANDO8(board))
return 0;
Expand All @@ -551,7 +575,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
return IS_STM32(board) ? true : false;

case HasColorLcd:
return IS_FAMILY_HORUS_OR_T16(board);
return IS_FAMILY_HORUS_OR_T16(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board);

case HasSDCard:
return IS_STM32(board);
Expand Down Expand Up @@ -749,6 +773,14 @@ StringTagMappingTable Boards::getAnalogNamesLookupTable(Board::Type board, const
{tr("TltY").toStdString(), "TILT_Y", 14},
});
}
else if (IS_FLYSKY_PL18(board)) {
tbl.insert(tbl.end(), {
{tr("VRA").toStdString(), "POT1"},
{tr("VRB").toStdString(), "POT2"},
{tr("VRC").toStdString(), "POT3"},
{tr("LS").toStdString(), "LS"},
{tr("RS").toStdString(), "RS"},
});
} else if (IS_HORUS_X10(board) || IS_FAMILY_T16(board)) {
if (version < adcVersion) {
tbl.insert(tbl.end(), {
Expand Down Expand Up @@ -863,6 +895,8 @@ QString Boards::getBoardName(Board::Type board)
return "Radiomaster T8";
case BOARD_FLYSKY_NV14:
return "FlySky NV14";
case BOARD_FLYSKY_PL18:
return "FlySky PL18";
case BOARD_BETAFPV_LR3PRO:
return "BETAFPV LR3PRO";
case BOARD_IFLIGHT_COMMANDO8:
Expand Down
10 changes: 8 additions & 2 deletions companion/src/firmwares/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ namespace Board {
BOARD_JUMPER_TLITE,
BOARD_JUMPER_TLITE_F4,
BOARD_FLYSKY_NV14,
BOARD_FLYSKY_PL18,
BOARD_RADIOMASTER_ZORRO,
BOARD_JUMPER_TPRO,
BOARD_BETAFPV_LR3PRO,
Expand Down Expand Up @@ -360,6 +361,11 @@ inline bool IS_FLYSKY_EL18(Board::Type board)
return (board == Board::BOARD_FLYSKY_EL18);
}

inline bool IS_FLYSKY_PL18(Board::Type board)
{
return (board == Board::BOARD_FLYSKY_PL18);
}

inline bool IS_TARANIS_XLITE(Board::Type board)
{
return board == Board::BOARD_TARANIS_XLITE || board == Board::BOARD_TARANIS_XLITES;
Expand Down Expand Up @@ -437,7 +443,7 @@ inline bool IS_FAMILY_HORUS(Board::Type board)

inline bool IS_FAMILY_HORUS_OR_T16(Board::Type board)
{
return IS_FAMILY_HORUS(board) || IS_FAMILY_T16(board) || IS_FLYSKY_NV14(board)/*generally*/;
return IS_FAMILY_HORUS(board) || IS_FAMILY_T16(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board);
}

inline bool IS_HORUS_OR_TARANIS(Board::Type board)
Expand All @@ -447,7 +453,7 @@ inline bool IS_HORUS_OR_TARANIS(Board::Type board)

inline bool IS_STM32(Board::Type board)
{
return IS_TARANIS(board) || IS_FAMILY_HORUS_OR_T16(board) || IS_FLYSKY_NV14(board);
return IS_TARANIS(board) || IS_FAMILY_HORUS_OR_T16(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board);
}

inline bool IS_ARM(Board::Type board)
Expand Down
8 changes: 7 additions & 1 deletion companion/src/firmwares/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ void GeneralSettings::init()
strcpy(bluetoothName, "t16");
else if (IS_FLYSKY_NV14(board))
strcpy(bluetoothName, "nv14");
else if (IS_FLYSKY_PL18(board))
strcpy(bluetoothName, "pl18");
else if (IS_FAMILY_HORUS_OR_T16(board))
strcpy(bluetoothName, "horus");
else if (IS_TARANIS_X9E(board) || IS_TARANIS_SMALL(board))
Expand Down Expand Up @@ -277,7 +279,7 @@ void GeneralSettings::setDefaultControlTypes(Board::Type board)
return;

// TODO: move to Boards, like with switches
if (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board)) {
if (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board)) {
potConfig[0] = Board::POT_WITH_DETENT;
potConfig[1] = Board::POT_MULTIPOS_SWITCH;
potConfig[2] = Board::POT_WITH_DETENT;
Expand All @@ -286,6 +288,10 @@ void GeneralSettings::setDefaultControlTypes(Board::Type board)
potConfig[0] = Board::POT_WITHOUT_DETENT;
potConfig[1] = Board::POT_WITHOUT_DETENT;
}
else if (IS_FLYSKY_PL18(board)) {
potConfig[0] = Board::POT_WITHOUT_DETENT;
potConfig[1] = Board::POT_WITHOUT_DETENT;
}
else if (IS_TARANIS_XLITE(board)) {
potConfig[0] = Board::POT_WITHOUT_DETENT;
potConfig[1] = Board::POT_WITHOUT_DETENT;
Expand Down
22 changes: 11 additions & 11 deletions companion/src/firmwares/opentx/opentxeeprom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ inline int MAX_XPOTS(Board::Type board, int version)

inline int MAX_SLIDERS_STORAGE(Board::Type board, int version)
{
if (version >= 219 && (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board)))
if (version >= 219 && (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board)))
return 4;
return Boards::getCapability(board, Board::Sliders);
}
Expand Down Expand Up @@ -180,7 +180,7 @@ inline int SWITCHES_CONFIG_SIZE(Board::Type board, int version)

inline int MAX_MOUSE_ANALOG_SOURCES(Board::Type board, int version)
{
if (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board))
if (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board))
return 2;
else
return 0;
Expand Down Expand Up @@ -208,10 +208,10 @@ inline int MAX_GYRO_ANALOGS(Board::Type board, int version)
#define MAX_CURVES(board, version) ((version >= 219 || HAS_LARGE_LCD(board)) ? 32 : 16)
#define MAX_GVARS(board, version) 9
#define MAX_SCRIPTS(board) (IS_FAMILY_HORUS_OR_T16(board) ? 9 : 7)
#define MAX_TELEMETRY_SENSORS(board, version) (version <= 218 ? 32 : ((IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS_X9(board) || IS_FLYSKY_NV14(board)) ? 60 : 40))
#define MAX_TELEMETRY_SENSORS(board, version) (version <= 218 ? 32 : ((IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS_X9(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) ? 60 : 40))
#define NUM_PPM_INPUTS(board, version) 16
#define ROTENC_COUNT(board, version) ((IS_STM32(board) && version >= 218) ? 0 : 1)
#define MAX_AUX_TRIMS(board) ((IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board)) ? 2 : 0)
#define MAX_AUX_TRIMS(board) ((IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board)) ? 2 : 0)
#define MAX_SOURCE_TYPE_SPECIAL(board, version) SOURCE_TYPE_SPECIAL_COUNT

inline int switchIndex(int i, Board::Type board, unsigned int version)
Expand Down Expand Up @@ -2640,7 +2640,7 @@ class TopBarField: public StructField {
TopBarField(DataField * parent, TopBarPersistentData & topBar, Board::Type board, unsigned int version):
StructField(parent, "Top Bar")
{
Append(new WidgetsContainerPersistentField<TopBarPersistentData>(this, topBar, IS_FLYSKY_NV14(board) ? 2 : 4, MAX_TOPBAR_OPTIONS, board, version));
Append(new WidgetsContainerPersistentField<TopBarPersistentData>(this, topBar, (IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) ? 2 : 4, MAX_TOPBAR_OPTIONS, board, version));
//dump();
}
};
Expand Down Expand Up @@ -2942,7 +2942,7 @@ void OpenTxModelData::beforeExport()

// TODO remove when enum not radio specific requires eeprom change and conversion
// Note: this must mirror reverse afterImport
if (!IS_FLYSKY_NV14(board))
if (!IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board))
modelData.trainerMode -= 1;

if (modelData.trainerMode > TRAINER_MODE_SLAVE_JACK) {
Expand Down Expand Up @@ -2989,7 +2989,7 @@ void OpenTxModelData::afterImport()

// TODO remove when enum not radio specific requires eeprom change and conversion
// Note: this must mirror reverse beforeExport
if (!IS_FLYSKY_NV14(board))
if (!IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board))
modelData.trainerMode += 1;

if (modelData.trainerMode > TRAINER_MODE_SLAVE_JACK) {
Expand Down Expand Up @@ -3035,7 +3035,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type

internalField.Append(new UnsignedField<16>(this, chkSum));

if (!IS_FAMILY_HORUS_OR_T16(board) || (IS_FLYSKY_NV14(board))) {
if (!IS_FAMILY_HORUS_OR_T16(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) {
internalField.Append(new UnsignedField<8>(this, generalData.currModelIndex));
internalField.Append(new UnsignedField<8>(this, generalData.contrast));
}
Expand Down Expand Up @@ -3099,11 +3099,11 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
internalField.Append(new SignedField<8>(this, generalData.PPM_Multiplier));
internalField.Append(new SignedField<8>(this, generalData.hapticLength));

if (version < 218 || (!IS_TARANIS(board) && !IS_FAMILY_HORUS_OR_T16(board)) || IS_FLYSKY_NV14(board)) {
if (version < 218 || (!IS_TARANIS(board) && !IS_FAMILY_HORUS_OR_T16(board)) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) {
internalField.Append(new UnsignedField<8>(this, generalData.reNavigation));
}

if ((!IS_TARANIS(board) && !IS_FAMILY_HORUS_OR_T16(board)) || IS_FLYSKY_NV14(board)) {
if ((!IS_TARANIS(board) && !IS_FAMILY_HORUS_OR_T16(board)) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) {
internalField.Append(new UnsignedField<8>(this, generalData.stickReverse));
}

Expand Down Expand Up @@ -3394,7 +3394,7 @@ void OpenTxGeneralData::afterImport()
{
if (IS_FAMILY_HORUS_OR_T16(board)) {
if (version < 220) { // re-initialise as no conversion possible
const char * themeName = IS_FLYSKY_NV14(board) ? "FlySky" : "EdgeTX";
const char * themeName = (IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) ? "FlySky" : "EdgeTX";
RadioTheme::init(themeName, generalData.themeData);
}
}
Expand Down
15 changes: 14 additions & 1 deletion companion/src/firmwares/opentx/opentxinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ const char * OpenTxEepromInterface::getName()
return "EdgeTX for FrSky X10 Express";
case BOARD_FLYSKY_NV14:
return "EdgeTX for FlySky NV14";
case BOARD_FLYSKY_PL18:
return "EdgeTX for FlySky PL18";
case BOARD_BETAFPV_LR3PRO:
return "EdgeTx for BETAFPV LR3PRO";
case BOARD_IFLIGHT_COMMANDO8:
Expand Down Expand Up @@ -658,6 +660,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
case LcdWidth:
if (IS_FLYSKY_NV14(board))
return 320;
else if (IS_FLYSKY_PL18(board))
return 480;
else if (IS_FAMILY_HORUS_OR_T16(board))
return 480;
else if (IS_TARANIS_SMALL(board))
Expand All @@ -669,6 +673,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
case LcdHeight:
if (IS_FLYSKY_NV14(board))
return 480;
else if (IS_FLYSKY_PL18(board))
return 320;
else if (IS_FAMILY_HORUS_OR_T16(board))
return 272;
else
Expand Down Expand Up @@ -770,7 +776,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
return IS_FAMILY_HORUS_OR_T16(board) || IS_RADIOMASTER_ZORRO(board) ||
IS_JUMPER_TPRO(board) || IS_RADIOMASTER_TX12_MK2(board) || IS_RADIOMASTER_BOXER(board);
case HasBluetooth:
return (IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board)|| IS_TARANIS_X9E(board) || IS_TARANIS_X9DP_2019(board) || IS_FLYSKY_NV14(board)) ? true : false;
return (IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board)|| IS_TARANIS_X9E(board) || IS_TARANIS_X9DP_2019(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) ? true : false;
case HasADCJitterFilter:
return IS_HORUS_OR_TARANIS(board);
case HasTelemetryBaudrate:
Expand Down Expand Up @@ -1412,6 +1418,13 @@ void registerOpenTxFirmwares()
addOpenTxRfOptions(firmware, FLEX + AFHDS3);
registerOpenTxFirmware(firmware);

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

/* BETAFPV LR3PRO board */
firmware = new OpenTxFirmware(FIRMWAREID("lr3pro"), QCoreApplication::translate("Firmware", "BETAFPV LiteRadio3 Pro"), BOARD_BETAFPV_LR3PRO);
addOpenTxCommonOptions(firmware);
Expand Down
Binary file added companion/src/images/simulator/PL18/bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added companion/src/images/simulator/PL18/left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added companion/src/images/simulator/PL18/right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added companion/src/images/simulator/PL18/top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions companion/src/simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ set(simulation_SRCS
simulateduiwidgetT8.cpp
simulateduiwidgetTX16S.cpp
simulateduiwidgetNV14.cpp
simulateduiwidgetPL18.cpp
simulatorinterface.cpp
simulatormainwindow.cpp
simulatorstartupdialog.cpp
Expand Down Expand Up @@ -61,6 +62,7 @@ set(simulation_UIS
simulateduiwidgetT8.ui
simulateduiwidgetTX16S.ui
simulateduiwidgetNV14.ui
simulateduiwidgetPL18.ui
simulatormainwindow.ui
simulatorstartupdialog.ui
simulatorwidget.ui
Expand Down
Loading
Loading