CENTERSTICKS filter to guarantee that stick center is always stick center. Not 0.1, 0.2 etc.. always 0.

This commit is contained in:
rob@marotori.com
2013-09-21 10:40:54 +00:00
parent 3d603143dd
commit 9d4887d864
2 changed files with 17 additions and 1 deletions
+10 -1
View File
@@ -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
}