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 Nov 20, 2023
1 parent f8576bc commit fb86941
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
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 fb86941

Please sign in to comment.