Skip to content

Commit

Permalink
Fixed rebase problems due to changes in PR #3894.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardclli committed Oct 29, 2023
1 parent db80520 commit 766461f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
4 changes: 2 additions & 2 deletions radio/src/gui/colorlcd/radio_diagkeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class RadioKeyDiagsWindow : public Window
dc->drawText(TRIM_MINUS_COLUMN, 1, "-", COLOR_THEME_PRIMARY1);
dc->drawText(TRIM_PLUS_COLUMN, 1, "+", COLOR_THEME_PRIMARY1);

#if !defined(PCBNV14)
#if !(defined(PCBNV14) || defined(PCBPL18))
// KEYS
coord_t y = 1;
for (uint8_t i = 0; i < keysGetMaxKeys(); i++) {
Expand All @@ -110,7 +110,7 @@ class RadioKeyDiagsWindow : public Window
dc->drawText(KEY_COLUMN, y, STR_ROTARY_ENCODER, COLOR_THEME_PRIMARY1);
dc->drawNumber(70, y, rotaryEncoderGetValue(), COLOR_THEME_PRIMARY1);
#endif
#else // PCBNV14 does NOT have physical keys, only remapped trim keys
#else // PCBNV14 and PCBPL18 does NOT have physical keys, only remapped trim keys
{
coord_t y = 1;
dc->drawText(KEY_COLUMN, y, keysGetLabel(KEY_ENTER), COLOR_THEME_PRIMARY1);
Expand Down
13 changes: 11 additions & 2 deletions radio/src/storage/yaml/yaml_datastructs_pl18.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
// Enums first
//

const struct YamlIdStr enum_HatsMode[] = {
{ HATSMODE_TRIMS_ONLY, "TRIMS_ONLY" },
{ HATSMODE_KEYS_ONLY, "KEYS_ONLY" },
{ HATSMODE_SWITCHABLE, "SWITCHABLE" },
{ HATSMODE_GLOBAL, "GLOBAL" },
{ 0, NULL }
};
const struct YamlIdStr enum_BacklightMode[] = {
{ e_backlight_mode_off, "backlight_mode_off" },
{ e_backlight_mode_keys, "backlight_mode_keys" },
Expand Down Expand Up @@ -284,7 +291,8 @@ static const struct YamlNode struct_CustomFunctionData[] = {
static const struct YamlNode struct_RadioData[] = {
YAML_UNSIGNED( "manuallyEdited", 1 ),
YAML_SIGNED( "timezoneMinutes", 3 ),
YAML_PADDING( 4 ),
YAML_ENUM("hatsMode", 2, enum_HatsMode),
YAML_PADDING( 2 ),
YAML_CUSTOM("semver",nullptr,w_semver),
YAML_CUSTOM("board",nullptr,w_board),
YAML_ARRAY("calib", 48, 22, struct_CalibData, NULL),
Expand Down Expand Up @@ -820,7 +828,8 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "disableTelemetryWarning", 1 ),
YAML_UNSIGNED( "showInstanceIds", 1 ),
YAML_UNSIGNED( "checklistInteractive", 1 ),
YAML_PADDING( 4 ),
YAML_ENUM("hatsMode", 2, enum_HatsMode),
YAML_PADDING( 2 ),
YAML_SIGNED( "customThrottleWarningPosition", 8 ),
YAML_UNSIGNED( "beepANACenter", 16 ),
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
Expand Down
2 changes: 1 addition & 1 deletion radio/src/targets/pl18/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ add_definitions(
-DSTM32F429_439xx -DSTM32F429xx
-DSDRAM -DCOLORLCD -DLIBOPENUI
-DHARDWARE_TOUCH -DHARDWARE_KEYS
-DSOFTWARE_KEYBOARD -DUSE_TRIMS_AS_BUTTONS)
-DSOFTWARE_KEYBOARD -DUSE_HATS_AS_KEYS)

set(SDRAM ON)

Expand Down
2 changes: 1 addition & 1 deletion radio/src/targets/pl18/bootloader/boot_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void bootloaderInitScreen()
lcdInitDisplayDriver();
backlightInit();
backlightEnable(100);
setTrimsAsButtons(true);
setHatsAsKeys(true);
}

static void bootloaderDrawTitle(const char* text)
Expand Down
2 changes: 2 additions & 0 deletions radio/src/targets/pl18/hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@
#define TRAINER_GPIO_AF LL_GPIO_AF_2
#define TRAINER_TIMER_FREQ (PERI1_FREQUENCY * TIMER_MULT_APB1)

//ROTARY emulation for trims as buttons
#define ROTARY_ENCODER_NAVIGATION

//BLUETOOTH
#define BLUETOOTH_ON_RCC_AHB1Periph RCC_AHB1Periph_GPIOI
Expand Down
2 changes: 1 addition & 1 deletion radio/src/targets/pl18/key_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ uint32_t readKeys()
{
uint32_t result = 0;

if (getTrimsAsButtons()) {
if (getHatsAsKeys()) {
uint32_t mkeys = _readKeyMatrix();
if (mkeys & (1 << TR4D)) result |= 1 << KEY_ENTER;
if (mkeys & (1 << TR4U)) result |= 1 << KEY_EXIT;
Expand Down

0 comments on commit 766461f

Please sign in to comment.