feat: Flysky PL18U Support (#6114)

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
richardclli
2025-06-21 18:31:11 +10:00
committed by GitHub
co-authored by Peter Feerick
parent d81513d4f2
commit f4c019bbb1
34 changed files with 1617 additions and 171 deletions
+1 -1
View File
@@ -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)
@@ -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
@@ -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) {
@@ -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)