[X9D] Autoswitch fixed
This commit is contained in:
@@ -145,10 +145,17 @@ int16_t checkIncDec(uint8_t event, int16_t val, int16_t i_min, int16_t i_max, ui
|
||||
if (s_editMode>0) {
|
||||
int8_t swtch = getMovedSwitch();
|
||||
if (swtch) {
|
||||
#if defined(PCBX9D)
|
||||
if(swtch == SWSRC_SH2)
|
||||
newval = (newval == SWSRC_SH2 ? SWSRC_SH0 : SWSRC_SH2);
|
||||
else if(swtch != SWSRC_SH0)
|
||||
newval = swtch;
|
||||
#else
|
||||
if (IS_MOMENTARY(newval) && IS_MOMENTARY(swtch))
|
||||
newval = -newval;
|
||||
else
|
||||
newval = swtch;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -972,7 +972,7 @@ int8_t getMovedSwitch()
|
||||
else if (i==6)
|
||||
result = 1+(3*5)+2+next;
|
||||
else
|
||||
result = 1+(3*5)+2+3+next;
|
||||
result = 1+(3*5)+2+3+(next!=0);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -316,7 +316,6 @@ enum EnumKeys {
|
||||
#if defined(PCBX9D)
|
||||
#define NUM_SWITCHES 8
|
||||
#define IS_3POS(sw) ((sw) != 5 && (sw) != 7)
|
||||
#define IS_MOMENTARY(sw) (sw == SWSRC_SH0)
|
||||
#define MAX_PSWITCH (SW_SH2-SW_SA0+1)
|
||||
#define NUM_POTS 4
|
||||
#define NUM_SW_SRCRAW 8
|
||||
|
||||
Reference in New Issue
Block a user