10#if EFI_PROD_CODE && HW_HELLEN
16 if (std::isnan(inputVoltage)) {
17 criticalError(
"temp error FuelLevelFunc NaN input");
19 return UnexpectedCode::Unknown;
20#if EFI_PROD_CODE && HW_HELLEN
24 return UnexpectedCode::Unknown;
26 }
else if (inputVoltage < engineConfiguration->fuelLevelLowThresholdVoltage) {
28 return UnexpectedCode::Low;
31 return UnexpectedCode::High;
51 const float diff = inputVoltage - prevFilteredValue;
57static bool isFirst =
true;
float filterFuelValue(float value)
void updateFilteredValue(float value)
SensorResult convert(float inputValue)
std::optional< float > m_filteredValue
static constexpr float MIN_FUEL_LEVEL_UPDATE_PERIOD_SEC
float getFuelLevelAlpha() const
static constexpr persistent_config_s * config
static constexpr engine_configuration_s * engineConfiguration
Timer hellenEnPinStateChange
PUBLIC_API_WEAK bool isBoardWithPowerManagement()
Timer hellenEnPinStateChange
constexpr float FUEL_LEVEL_AVERAGING_ALPHA
expected< float > SensorResult
float fuelLevelAveragingAlpha
float fuelLevelHighThresholdVoltage
float fuelLevelUpdatePeriodSec
scaled_channel< uint16_t, 1000, 1 > fuelLevelBins[FUEL_LEVEL_TABLE_COUNT]
uint8_t fuelLevelValues[FUEL_LEVEL_TABLE_COUNT]