Updates to allow sticks to be reversed at compile time.
e.g. make PCB=SKY9X FRSKY=YES HAPTIC=YES AUDIO=YES STICK_AIL_REV=YES STICK_THR_REV=YES STICK_RUD_REV=YES
This commit is contained in:
@@ -89,6 +89,11 @@ NAVIGATION = NO
|
||||
# Values = YES, NO
|
||||
AUTOSWITCH = NO
|
||||
|
||||
# Swap Stick Inputs for AIL,ELE,RUD,THR
|
||||
# Used in some scenarios where stick/pot entries
|
||||
# cannot be changed by soldering the pots.
|
||||
|
||||
|
||||
# Sources automatic selection
|
||||
# Values = YES, NO
|
||||
AUTOSOURCE = NO
|
||||
@@ -741,6 +746,22 @@ ifeq ($(AUTOSOURCE), YES)
|
||||
CPPDEFS += -DAUTOSOURCE
|
||||
endif
|
||||
|
||||
ifeq ($(STICK_AIL_REV), YES)
|
||||
CPPDEFS += -DSTICK_AIL_REV
|
||||
endif
|
||||
|
||||
ifeq ($(STICK_ELE_REV), YES)
|
||||
CPPDEFS += -DSTICK_ELE_REV
|
||||
endif
|
||||
|
||||
ifeq ($(STICK_RUD_REV), YES)
|
||||
CPPDEFS += -DSTICK_RUD_REV
|
||||
endif
|
||||
|
||||
ifeq ($(STICK_THR_REV), YES)
|
||||
CPPDEFS += -DSTICK_THR_REV
|
||||
endif
|
||||
|
||||
ifeq ($(DBLKEYS), YES)
|
||||
ifeq ($(PCB), $(filter $(PCB), 9XR 9XR128 9XR2561))
|
||||
$(warning Sorry, DBLKEYS doesnt work on 9XR)
|
||||
|
||||
@@ -2265,8 +2265,36 @@ BeepANACenter evalSticks(uint8_t mode)
|
||||
v = -v;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(STICK_THR_REV)
|
||||
v = -v;
|
||||
if (g_model.throttleReversed && ch==THR_STICK)
|
||||
v = +v;
|
||||
#else
|
||||
//normal stick operation but reveresed in model config
|
||||
if (g_model.throttleReversed && ch==THR_STICK)
|
||||
v = -v;
|
||||
#endif
|
||||
|
||||
#if defined(STICK_AIL_REV)
|
||||
if (ch==AIL_STICK)
|
||||
v = -v;
|
||||
#endif
|
||||
|
||||
#if defined(STICK_ELE_REV)
|
||||
if (ch==ELE_STICK)
|
||||
v = -v;
|
||||
#endif
|
||||
|
||||
#if defined(STICK_RUD_REV)
|
||||
if (ch==RUD_STICK)
|
||||
v = -v;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* end rob hack */
|
||||
|
||||
|
||||
#if defined(EXTRA_3POS)
|
||||
if (i == POT1+EXTRA_3POS-1) {
|
||||
|
||||
Reference in New Issue
Block a user