only:reusing ExpAverage

This commit is contained in:
rusefillc 2024-12-16 23:40:39 -05:00
parent ab68587ce8
commit b8f40a9ee7
1 changed files with 5 additions and 9 deletions

View File

@ -22,7 +22,7 @@
*/
#include "pch.h"
#include "exp_average.h"
#if EFI_MAP_AVERAGING
@ -101,16 +101,12 @@ SensorResult MapAverager::submit(float volts) {
return result;
}
static ExpAverage expAverage;
// huh? why is this killing unit tests _linking_ only on WINDOWS?! PUBLIC_API_WEAK
float filterMapValue(float value) {
static float state = 0;
if (state == 0) {
state = value;
return value;
}
float result = state + engineConfiguration->mapExpAverageAlpha * (value - state);
state = result;
return result;
expAverage.setSmoothingFactor(engineConfiguration->mapExpAverageAlpha);
return expAverage.initOrAverage(value);
}
void MapAverager::stop() {