feat: Option for inverting rotary encoder direction (#1690)
* feat: Add option for rotary encoder direction Based heavily on opentx/opentx#8852 by @3djc * companion ui elements * Cleanup * Hook up UI, reading setting from yaml * Teach simulator about rotEncDirection * Simu and radio default scroll direction correction Otherwise the "default" would be the opposite to how it has always been * Remove what will be a confict with fix in #1586 * Wasn't using rotEncDirection consistently * Zorro RE dir is opp to TX16, TX12, TPro, X9D+2019
This commit is contained in:
@@ -102,6 +102,7 @@ enum {
|
||||
ITEM_RADIO_SETUP_USB_MODE,
|
||||
CASE_JACK_DETECT(ITEM_RADIO_SETUP_JACK_MODE)
|
||||
ITEM_RADIO_SETUP_RX_CHANNEL_ORD,
|
||||
CASE_ROTARY_ENCODER(ITEM_RADIO_SETUP_ROTARY_INVERSE)
|
||||
ITEM_RADIO_SETUP_STICK_MODE_LABELS,
|
||||
ITEM_RADIO_SETUP_STICK_MODE,
|
||||
ITEM_RADIO_SETUP_MAX
|
||||
@@ -175,6 +176,7 @@ void menuRadioSetup(event_t event)
|
||||
0,
|
||||
0, // USB mode
|
||||
CASE_JACK_DETECT(0) // Jack mode
|
||||
CASE_ROTARY_ENCODER(0)
|
||||
0, COL_TX_MODE, 0, 1/*to force edit mode*/});
|
||||
|
||||
if (event == EVT_ENTRY) {
|
||||
@@ -658,6 +660,12 @@ void menuRadioSetup(event_t event)
|
||||
#endif
|
||||
break;
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
case ITEM_RADIO_SETUP_ROTARY_INVERSE:
|
||||
g_eeGeneral.rotEncDirection = editCheckBox(g_eeGeneral.rotEncDirection, RADIO_SETUP_2ND_COLUMN, y, STR_INVERT_ROTARY, attr, event);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ITEM_RADIO_SETUP_STICK_MODE:
|
||||
lcdDrawChar(2*FW, y, '1'+reusableBuffer.generalSettings.stickMode, attr);
|
||||
for (uint8_t i=0; i<NUM_STICKS; i++) {
|
||||
|
||||
Reference in New Issue
Block a user