1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-17 21:35:27 +03:00

Apply to all targets

This commit is contained in:
3djc 2021-01-19 08:50:10 +01:00
parent 233d1d2630
commit ce028e7fe4
5 changed files with 6 additions and 4 deletions

View file

@ -136,7 +136,7 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
#if defined(AUTOSWITCH) #if defined(AUTOSWITCH)
else { else {
uint8_t swtch = abs(getMovedSwitch()); uint8_t swtch = abs(getMovedSwitch());
if (swtch) { if (swtch && !IS_SWITCH_MULTPOS(swtch)) {
newval = switchToMix(swtch); newval = switchToMix(swtch);
} }
} }

View file

@ -106,7 +106,7 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
#if defined(AUTOSWITCH) #if defined(AUTOSWITCH)
else { else {
unsigned int swtch = abs(getMovedSwitch()); unsigned int swtch = abs(getMovedSwitch());
if (swtch) { if (swtch && !IS_SWITCH_MULTPOS(swtch)) {
newval = switchToMix(swtch); newval = switchToMix(swtch);
} }
} }

View file

@ -173,7 +173,7 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
#if defined(AUTOSWITCH) #if defined(AUTOSWITCH)
else { else {
unsigned int swtch = abs(getMovedSwitch()); unsigned int swtch = abs(getMovedSwitch());
if (swtch) { if (swtch && !IS_SWITCH_MULTPOS(swtch)) {
newval = switchToMix(swtch); newval = switchToMix(swtch);
} }
} }

View file

@ -166,7 +166,7 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
#if defined(AUTOSWITCH) #if defined(AUTOSWITCH)
else { else {
uint8_t swtch = abs(getMovedSwitch()); uint8_t swtch = abs(getMovedSwitch());
if (swtch) { if (swtch && !IS_SWITCH_MULTPOS(swtch)) {
newval = switchToMix(swtch); newval = switchToMix(swtch);
} }
} }

View file

@ -276,11 +276,13 @@ void memswap(void * a, void * b, uint8_t size);
#define IS_POT_AVAILABLE(x) (IS_POT(x) && POT_CONFIG(x)!=POT_NONE) #define IS_POT_AVAILABLE(x) (IS_POT(x) && POT_CONFIG(x)!=POT_NONE)
#define IS_POT_SLIDER_AVAILABLE(x) (IS_POT_AVAILABLE(x)) #define IS_POT_SLIDER_AVAILABLE(x) (IS_POT_AVAILABLE(x))
#define IS_MULTIPOS_CALIBRATED(cal) (cal->count>0 && cal->count<XPOTS_MULTIPOS_COUNT) #define IS_MULTIPOS_CALIBRATED(cal) (cal->count>0 && cal->count<XPOTS_MULTIPOS_COUNT)
#define IS_SWITCH_MULTPOS(x) (SWSRC_FIRST_MULTIPOS_SWITCH <= (x) && (x) <= SWSRC_LAST_MULTIPOS_SWITCH)
#else #else
#define IS_POT_MULTIPOS(x) (false) #define IS_POT_MULTIPOS(x) (false)
#define IS_POT_WITHOUT_DETENT(x) (true) #define IS_POT_WITHOUT_DETENT(x) (true)
#define IS_POT_SLIDER_AVAILABLE(x) (true) #define IS_POT_SLIDER_AVAILABLE(x) (true)
#define IS_MULTIPOS_CALIBRATED(cal) (false) #define IS_MULTIPOS_CALIBRATED(cal) (false)
#define IS_SWITCH_MULTPOS(x) (false)
#endif #endif
#if defined(PWR_BUTTON_PRESS) #if defined(PWR_BUTTON_PRESS)