Very weak filter added to instantaneous MAP readings

This commit is contained in:
Josh Stewart 2017-02-12 14:43:18 +13:00
parent 667e80dc26
commit 91512b775a
2 changed files with 5 additions and 2 deletions

View File

@ -6,8 +6,9 @@
#define ADCFILTER_TPS 128
#define ADCFILTER_CLT 180
#define ADCFILTER_IAT 180
#define ADCFILTER_O2 128
#define ADCFILTER_O2 128
#define ADCFILTER_BAT 128
#define ADCFILTER_MAP 20 //This is only used on Instantaneous MAP readings and is intentionally very weak to allow for faster response
#define BARO_MIN 87
#define BARO_MAX 108

View File

@ -58,8 +58,10 @@ void instanteneousMAPReading()
#endif
//Error checking
if(tempReading >= VALID_MAP_MAX || tempReading <= VALID_MAP_MIN) { mapErrorCount += 1; }
else { currentStatus.mapADC = tempReading; mapErrorCount = 0; }
else { mapErrorCount = 0; }
currentStatus.mapADC = ADC_FILTER(tempReading, ADCFILTER_MAP, currentStatus.mapADC); //Very weak filter
currentStatus.MAP = fastMap1023toX(currentStatus.mapADC, configPage1.mapMax); //Get the current MAP value
}