feat: More rotary encoder options for B&W screens (see #2045)

* First build

* Fix X9

* Update api_general.cpp

* Update translations.h

* clean up translations

* fix: B&W option handling, remove magic numbers, cleanup
- Remove references to invertRotary, change to RotEncDir or similar
- Add compatabilty importing to companion, firmware
- Rename Lua API call
- Move magic numbers to enum
- Improve B&W option handling so it doesn't apply changes while in menu

* chore: yaml regen

* fix: Add missing guards for X9D/X9D+

* fix: Wrong enum name in simu

* fix(cpn): Use correct names for UI elements

* fix: Translations

* fix: Allow `rotEncMode` in all yaml due to x9d var
Of the three X9D variants, the X9D+2019 is the only one that
has a rotary encoder as standard. However, as the base config
file is for the X9D, this meant it wasn't reading or writing the
config value. Rather than add a seperate config file for it for
a single variable, simple to just allow it across all targets.

* fix: Companion string, change colorlcd to `Choice`

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
breadoven
2022-08-04 20:06:17 +10:00
committed by GitHub
co-authored by Peter Feerick
parent 5752cf4061
commit 62692dba6a
53 changed files with 435 additions and 131 deletions
+8 -4
View File
@@ -812,7 +812,7 @@ PACK(struct TrainerData {
#if defined(BUZZER)
#define BUZZER_FIELD int8_t buzzerMode:2 // -2=quiet, -1=only alarms, 0=no keys, 1=all (only used on AVR radios without audio hardware)
#else
#define BUZZER_FIELD int8_t spare1:2 SKIP
#define BUZZER_FIELD int8_t spare2:2 SKIP
#endif
PACK(struct RadioData {
@@ -830,7 +830,7 @@ PACK(struct RadioData {
int8_t antennaMode:2 ENUM(AntennaModes);
uint8_t disableRtcWarning:1;
uint8_t keysBacklight:1;
int8_t rotEncDirection:1;
NOBACKUP(uint8_t spare1:1 SKIP);
NOBACKUP(uint8_t internalModule ENUM(ModuleType));
NOBACKUP(TrainerData trainer);
NOBACKUP(uint8_t view); // index of view in main screen
@@ -899,13 +899,17 @@ PACK(struct RadioData {
char ownerRegistrationID[PXX2_LEN_REGISTRATION_ID];
CUST_ATTR(rotEncDirection, r_rotEncDirection, nullptr);
NOBACKUP(uint8_t rotEncMode:2);
NOBACKUP(int8_t uartSampleMode:2); // See UartSampleModes
#if defined(STICK_DEAD_ZONE)
NOBACKUP(uint8_t stickDeadZone:3);
NOBACKUP(uint8_t spare2:3 SKIP);
#else
NOBACKUP(uint8_t spare2:6 SKIP);
NOBACKUP(uint8_t stickDeadZoneSpare:3 SKIP);
#endif
NOBACKUP(uint8_t spare4:1 SKIP);
#if defined(IMU)
NOBACKUP(int8_t imuMax);