CENTERSTICKS filter to guarantee that stick center is always stick center. Not 0.1, 0.2 etc.. always 0.
This commit is contained in:
+10
-1
@@ -2267,7 +2267,7 @@ BeepANACenter evalSticks(uint8_t mode)
|
||||
|
||||
if (g_model.throttleReversed && ch==THR_STICK)
|
||||
v = -v;
|
||||
|
||||
|
||||
|
||||
#if defined(EXTRA_3POS)
|
||||
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);
|
||||
#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;
|
||||
anas[ch] = v; //set values for mixer
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user