CENTERSTICKS filter to guarantee that stick center is always stick center. Not 0.1, 0.2 etc.. always 0.
This commit is contained in:
@@ -215,6 +215,9 @@ TTS = $(TRANSLATIONS)
|
|||||||
# Values = imperial, metric
|
# Values = imperial, metric
|
||||||
UNITS = METRIC
|
UNITS = METRIC
|
||||||
|
|
||||||
|
# CENTER STICK INPUTS
|
||||||
|
CENTERSTICKS = YES
|
||||||
|
|
||||||
# Default Tx Mode
|
# Default Tx Mode
|
||||||
# Values = NO / 1 / 2 / 3 / 4
|
# Values = NO / 1 / 2 / 3 / 4
|
||||||
DEFAULT_MODE = NO
|
DEFAULT_MODE = NO
|
||||||
@@ -750,6 +753,10 @@ ifeq ($(TARANIS_STICKS), YES)
|
|||||||
CPPDEFS += -DTARANIS_STICKS
|
CPPDEFS += -DTARANIS_STICKS
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CENTERSTICKS), YES)
|
||||||
|
CPPDEFS += -DCENTERSTICKS
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(DBLKEYS), YES)
|
ifeq ($(DBLKEYS), YES)
|
||||||
ifeq ($(PCB), $(filter $(PCB), 9XR 9XR128 9XR2561))
|
ifeq ($(PCB), $(filter $(PCB), 9XR 9XR128 9XR2561))
|
||||||
|
|||||||
+10
-1
@@ -2267,7 +2267,7 @@ BeepANACenter evalSticks(uint8_t mode)
|
|||||||
|
|
||||||
if (g_model.throttleReversed && ch==THR_STICK)
|
if (g_model.throttleReversed && ch==THR_STICK)
|
||||||
v = -v;
|
v = -v;
|
||||||
|
|
||||||
|
|
||||||
#if defined(EXTRA_3POS)
|
#if defined(EXTRA_3POS)
|
||||||
if (i == POT1+EXTRA_3POS-1) {
|
if (i == POT1+EXTRA_3POS-1) {
|
||||||
@@ -2315,6 +2315,15 @@ BeepANACenter evalSticks(uint8_t mode)
|
|||||||
v = (int32_t(v)*calc100toRESX(g_model.swashR.value))/int32_t(d);
|
v = (int32_t(v)*calc100toRESX(g_model.swashR.value))/int32_t(d);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CENTERSTICKS)
|
||||||
|
if(ch==THR_STICK || ch == ELE_STICK || ch == RUD_STICK || ch == AIL_STICK){
|
||||||
|
uint8_t stmp = (uint16_t)abs(v) / 16;
|
||||||
|
if(stmp <= 0.1 && stmp >= -0.1){
|
||||||
|
v = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
rawAnas[ch] = v;
|
rawAnas[ch] = v;
|
||||||
anas[ch] = v; //set values for mixer
|
anas[ch] = v; //set values for mixer
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user