Fix for issue 176. The fix was very easy since someone had already defined a hard coded end tolerance constant for the sticks of the 9X (value: 64). The fix only applies for PCB9XR and PCB9XR128
After some practical testing I lowered the vale to 16 for the 9XR. 32 does not work well. The sticks of the 9XR are really, really sloppy. I defined a new constant in the middle of the calib function, which is not very clean. Feel free to move this to a better place.
This commit is contained in:
+10
-2
@@ -1068,9 +1068,17 @@ void menuGeneralCalib(uint8_t event)
|
||||
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i])>50) {
|
||||
g_eeGeneral.calibMid[i] = reusableBuffer.calib.midVals[i];
|
||||
int16_t v = reusableBuffer.calib.midVals[i] - reusableBuffer.calib.loVals[i];
|
||||
g_eeGeneral.calibSpanNeg[i] = v - v/64;
|
||||
|
||||
// Stick tolerance varies between transmitters, Higher is better
|
||||
#if defined (PCB9XR) || defined (PCB9XR128)
|
||||
#define STICK_TOLERANCE 16
|
||||
#else
|
||||
#define STICK_TOLERANCE 64
|
||||
#endif
|
||||
|
||||
g_eeGeneral.calibSpanNeg[i] = v - v/STICK_TOLERANCE;
|
||||
v = reusableBuffer.calib.hiVals[i] - reusableBuffer.calib.midVals[i];
|
||||
g_eeGeneral.calibSpanPos[i] = v - v/64;
|
||||
g_eeGeneral.calibSpanPos[i] = v - v/STICK_TOLERANCE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user