Skip to content

Commit

Permalink
Amended some PL18 properties in companion.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardclli committed Dec 4, 2023
1 parent 6dd943a commit 816dd28
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 23 deletions.
4 changes: 3 additions & 1 deletion companion/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,10 @@ elseif(PCB STREQUAL X10 AND PCBREV STREQUAL TX16S)
set(FLAVOUR tx16s)
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL T18)
set(FLAVOUR t18)
elseif(PCB STREQUAL NV14 AND PCBREV STREQUAL EL18)
elseif(PCB STREQUAL NV14 AND PCBREV STREQUAL EL18)
set(FLAVOUR el18)
elseif(PCB STREQUAL PL18)
set(FLAVOUR pl18)
else()
string(TOLOWER ${PCB} FLAVOUR)
endif()
Expand Down
6 changes: 5 additions & 1 deletion companion/src/companion.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,11 @@
<file>images/simulator/NV14/left.png</file>
<file>images/simulator/NV14/right.png</file>
<file>images/simulator/NV14/top.png</file>
<file>images/simulator/NV14/bottom.png</file>
<file>images/simulator/PL18/bottom.png</file>
<file>images/simulator/PL18/left.png</file>
<file>images/simulator/PL18/right.png</file>
<file>images/simulator/PL18/top.png</file>
<file>images/simulator/PL18/bottom.png</file>
<file>images/wizard/ailerons.png</file>
<file>images/wizard/airbrakes.png</file>
<file>images/wizard/elevons.png</file>
Expand Down
3 changes: 2 additions & 1 deletion companion/src/firmwares/boards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
return false;

case SportMaxBaudRate:
if (IS_FAMILY_T16(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || IS_TARANIS_X7_ACCESS(board) ||
if (IS_FAMILY_T16(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || IS_FLYSKY_PL18(board) ||IS_TARANIS_X7_ACCESS(board) ||
(IS_TARANIS(board) && !IS_TARANIS_XLITE(board) && !IS_TARANIS_X7(board) && !IS_TARANIS_X9LITE(board)))
return 400000; // 400K and higher
else
Expand Down Expand Up @@ -1232,6 +1232,7 @@ int Boards::getDefaultInternalModules(Board::Type board)
case BOARD_JUMPER_TLITE_F4:
case BOARD_JUMPER_TPRO:
case BOARD_JUMPER_TPROV2:
case BOARD_FLYSKY_PL18:
return (int)MODULE_TYPE_MULTIMODULE;

case BOARD_BETAFPV_LR3PRO:
Expand Down
2 changes: 1 addition & 1 deletion companion/src/firmwares/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ void GeneralSettings::init()

internalModule = g.profile[g.sessionId()].defaultInternalModule();

if (IS_FLYSKY_NV14(board))
if (IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board))
stickDeadZone = 2;

}
Expand Down
4 changes: 2 additions & 2 deletions companion/src/firmwares/opentx/opentxeeprom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ inline int MAX_POTS_STORAGE(Board::Type board, int version)
{
if (version <= 218 && IS_FAMILY_HORUS_OR_T16(board))
return 3;
if (version <= 220 && IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board))
if (version <= 220 && IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board))
return 5;
if (IS_FAMILY_T12(board))
return 2;
Expand Down Expand Up @@ -2608,7 +2608,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) || IS_FLYSKY_PL18(board)) ? 2 : 4, MAX_TOPBAR_OPTIONS, board, version));
Append(new WidgetsContainerPersistentField<TopBarPersistentData>(this, topBar, IS_FLYSKY_NV14(board) ? 2 : 4, MAX_TOPBAR_OPTIONS, board, version));
//dump();
}
};
Expand Down
2 changes: 1 addition & 1 deletion companion/src/generaledit/generalsetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ ui(new Ui::GeneralSetup)
ui->usbModeCB->hide();
}

if (IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board)) {
if (IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) {
ui->hatsModeCB->setModel(new FilteredItemModel(GeneralSettings::hatsModeItemModel()));
ui->hatsModeCB->setField(generalSettings.hatsMode, this);
}
Expand Down
2 changes: 1 addition & 1 deletion companion/src/modeledit/setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,7 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge

ui->trimsDisplay->setField(model.trimsDisplay, this);

if (IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board)) {
if (IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) {
ui->cboHatsMode->setModel(panelFilteredModels->getItemModel(FIM_HATSMODE));
ui->cboHatsMode->setField(model.hatsMode, this);
}
Expand Down
2 changes: 1 addition & 1 deletion companion/src/modelprinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ QString ModelPrinter::printSettingsTrim()
str << printLabelValue(tr("Display"), printTrimsDisplayMode());
str << printLabelValue(tr("Extended"), printBoolean(model.extendedTrims, BOOLEAN_YESNO));
Board::Type board = firmware->getBoard();
if (IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board)) {
if (IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) {
str << printLabelValue(tr("Hats Mode"), printHatsMode());
}
return str.join(" ");
Expand Down
35 changes: 21 additions & 14 deletions radio/src/targets/pl18/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
option(UNEXPECTED_SHUTDOWN "Enable the Unexpected Shutdown screen" ON)
option(STICKS_DEAD_ZONE "Enable sticks dead zone" YES)
option(MULTIMODULE "DIY Multiprotocol TX Module (https://github.com/pascallanger/DIY-Multiprotocol-TX-Module)" ON)
option(AFHDS2 "Support for AFHDS2" OFF)
option(GHOST "Ghost TX Module" ON)
option(PXX1 "PXX1 protocol support" ON)
option(PXX2 "PXX2 protocol support" OFF)
option(AFHDS3 "AFHDS3 TX Module" ON)
option(MULTIMODULE "DIY Multiprotocol TX Module (https://github.com/pascallanger/DIY-Multiprotocol-TX-Module)" ON)
option(GHOST "Ghost TX Module" ON)
option(MODULE_SIZE_STD "Standard size TX Module" ON)
option(LUA_MIXER "Enable LUA mixer/model scripts support" ON)

Expand All @@ -16,20 +15,31 @@ set(STORAGE_MODELSLIST YES)
set(HAPTIC YES)
set(GUI_DIR colorlcd)
set(BITMAPS_DIR 480x272)
set(HARDWARE_EXTERNAL_MODULE YES)
set(WIRELESS_CHARGER YES)
set(TARGET_DIR pl18)

set(LINKER_SCRIPT targets/pl18/stm32f4_flash.ld)
set(RTC_BACKUP_RAM YES)
set(PPM_LIMITS_SYMETRICAL YES)
set(USB_SERIAL ON CACHE BOOL "Enable USB serial (CDC)")
set(HARDWARE_EXTERNAL_MODULE YES)
set(WIRELESS_CHARGER YES)

if(BOOTLOADER)
set(LINKER_SCRIPT targets/pl18/stm32f4_flash_bootloader.ld)
else()
set(LINKER_SCRIPT targets/pl18/stm32f4_flash.ld)
endif()

#option(STICKS_DEAD_ZONE "Enable sticks dead zone" YES)
#option(AFHDS2 "Support for AFHDS2" OFF)


# for size report script
set(CPU_TYPE_FULL STM32F429xI)
set(SIZE_TARGET_MEM_DEFINE "MEM_SIZE_SDRAM2=8192")
option(USB_SERIAL "Enable USB serial (CDC)" ON)

set(RF_BAUD_RATE 921600 230400 115200 57600 38400 19200 9600 4800 2400 1200)
set(PCB_RF_BAUD 921600 CACHE STRING "INTERNAL_MODULE_BAUDRATE: ${RF_BAUD_RATE}")
set_property(CACHE PCB_RF_BAUD PROPERTY STRINGS ${RF_BAUD_RATE})
#set(RF_BAUD_RATE 921600 230400 115200 57600 38400 19200 9600 4800 2400 1200)
#set(PCB_RF_BAUD 921600 CACHE STRING "INTERNAL_MODULE_BAUDRATE: ${RF_BAUD_RATE}")
#set_property(CACHE PCB_RF_BAUD PROPERTY STRINGS ${RF_BAUD_RATE})

set(FLAVOUR pl18)
add_definitions(-DPCBPL18 -DPCBFLYSKY)
Expand Down Expand Up @@ -99,13 +109,10 @@ set(SRC
set(GVAR_SCREEN model_gvars.cpp)

if(BOOTLOADER)
set(LINKER_SCRIPT targets/pl18/stm32f4_flash_bootloader.ld)
set(FIRMWARE_TARGET_SRC
${FIRMWARE_TARGET_SRC}
../common/arm/loadboot.cpp
)
else()
set(LINKER_SCRIPT targets/pl18/stm32f4_flash.ld)
endif()

set(SRC
Expand Down

0 comments on commit 816dd28

Please sign in to comment.