Skip to content

feat: Flysky PL18U Support #6114

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
1 change: 1 addition & 0 deletions fw.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
["Flysky NV14", "nv14-"],
["Flysky PL18", "pl18-"],
["Flysky PL18EV", "pl18ev-"],
["Flysky PL18U", "pl18u-"],
["Flysky NB4+", "nb4p-"],
["Flysky ST16", "st16-"],
["FrSky Horus X10", "x10-"],
Expand Down
2 changes: 1 addition & 1 deletion radio/src/gui/colorlcd/mainview/sliders.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class MainViewSlider : public Window
MainViewSlider(Window* parent, const rect_t& rect, uint8_t idx,
bool isVertical);

#if defined(RADIO_PL18) || defined(RADIO_PL18EV)
#if defined(RADIO_PL18) || defined(RADIO_PL18EV) || defined(RADIO_PL18U)
static constexpr coord_t SLIDER_SIZE = 136; // to fit 3 across bottom row
#else
static LAYOUT_SIZE_SCALED_EVEN(SLIDER_SIZE, 160, 120)
Expand Down
14 changes: 13 additions & 1 deletion radio/src/gui/colorlcd/mainview/view_main_decoration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,15 @@ void ViewMainDecoration::createSliders(Window* ml, Window* mr, Window* bl, Windo
if (IS_POT_AVAILABLE(pot)) {
sliders[pot] = new MainViewHorizontalSlider(bl, pot);
}
#if defined(RADIO_PL18U)
pot += 2;
#else
pot += 1;
#endif

// Bottom center 6POS
if (IS_POT_AVAILABLE(pot)) {
#if defined(RADIO_PL18) || defined(RADIO_PL18EV)
#if defined(RADIO_PL18) || defined(RADIO_PL18EV) || defined(RADIO_PL18U)
sliders[pot] = new MainViewHorizontalSlider(bc, pot);
pot += 1;
#else
Expand All @@ -136,10 +140,18 @@ void ViewMainDecoration::createSliders(Window* ml, Window* mr, Window* bl, Windo
}

// Bottom right horizontal slider

#if defined(RADIO_PL18U)
pot -= 2;
#endif
if (IS_POT_AVAILABLE(pot)) {
sliders[pot] = new MainViewHorizontalSlider(br, pot);
}
#if defined(RADIO_PL18U)
pot += 2;
#else
pot += 1;
#endif

auto max_pots = adcGetMaxInputs(ADC_INPUT_FLEX);
if (max_pots > pot) {
Expand Down
17 changes: 10 additions & 7 deletions radio/src/gui/colorlcd/radio/radio_diagkeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,18 @@
#include "libopenui.h"
#include "edgetx.h"

#if defined(RADIO_NB4P)
static const uint8_t _trimMap[MAX_TRIMS * 2] = {0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15};
#if defined(RADIO_PL18U)
static const uint8_t _trimMap[MAX_TRIMS * 2] = {6, 7, 4, 5, 2, 3, 0, 1,
10, 11, 8, 9, 12, 13, 14, 15};
#elif defined(RADIO_NB4P)
static const uint8_t _trimMap[MAX_TRIMS * 2] = {0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15};
#elif defined(PCBPL18)
static const uint8_t _trimMap[MAX_TRIMS * 2] = {8, 9, 10, 11, 12, 13, 14, 15,
2, 3, 4, 5, 0, 1, 6, 7};
static const uint8_t _trimMap[MAX_TRIMS * 2] = {8, 9, 10, 11, 12, 13, 14, 15,
2, 3, 4, 5, 0, 1, 6, 7};
#else
static const uint8_t _trimMap[MAX_TRIMS * 2] = {6, 7, 4, 5, 2, 3,
0, 1, 8, 9, 10, 11};
static const uint8_t _trimMap[MAX_TRIMS * 2] = {6, 7, 4, 5, 2, 3,
0, 1, 8, 9, 10, 11};
#endif

static EnumKeys get_ith_key(uint8_t i)
Expand Down
2 changes: 2 additions & 0 deletions radio/src/storage/yaml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ elseif(PCB STREQUAL PL18)
set(YAML_GEN_OUTPUT storage/yaml/yaml_datastructs_nb4p.cpp)
elseif(PCBREV STREQUAL NV14)
set(YAML_GEN_OUTPUT storage/yaml/yaml_datastructs_nv14_family.cpp)
elseif(PCBREV STREQUAL PL18U)
set(YAML_GEN_OUTPUT storage/yaml/yaml_datastructs_pl18u.cpp)
else()
set(YAML_GEN_OUTPUT storage/yaml/yaml_datastructs_pl18.cpp)
endif()
Expand Down
2 changes: 2 additions & 0 deletions radio/src/storage/yaml/yaml_datastructs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#include "yaml_datastructs_nb4p.cpp"
#elif defined(RADIO_NV14_FAMILY)
#include "yaml_datastructs_nv14_family.cpp"
#elif defined(RADIO_PL18U)
#include "yaml_datastructs_pl18u.cpp"
#else
#include "yaml_datastructs_pl18.cpp"
#endif
Expand Down
Loading
Loading