Re #3233: Better ADC jitter filter: using inverted formula and scaled input value for jitter filter, gives better result for small changes

This commit is contained in:
Damjan Adamic
2016-02-28 17:58:13 +01:00
parent 3004a61695
commit 9a40830f8a
7 changed files with 157 additions and 71 deletions
+1 -1
View File
@@ -280,7 +280,7 @@ void getSwitchesPosition(bool startup)
for (int i=0; i<NUM_XPOTS; i++) {
if (IS_POT_MULTIPOS(POT1+i)) {
StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[POT1+i];
if (calib->count>0 && calib->count<XPOTS_MULTIPOS_COUNT) {
if (IS_MULTIPOS_CALIBRATED(calib)) {
uint8_t pos = anaIn(POT1+i) / (2*RESX/calib->count);
uint8_t previousPos = potsPos[i] >> 4;
uint8_t previousStoredPos = potsPos[i] & 0x0F;