16 return UnexpectedCode::High;
20 return UnexpectedCode::Low;
58 float invTimeConstant = rpm /
param;
59 float alpha = (1e-3 * FAST_CALLBACK_PERIOD_MS) * invTimeConstant;
64 }
else if (alpha > 0.98f) {
71 m_lastValue = alpha * input + (1 - alpha) * m_lastValue;
76 mutable float m_lastValue = 0;
static AdcSubscriptionEntry * SubscribeSensor(FunctionalSensorBase &sensor, adc_channel_e channel, float lowpassCutoffHZ, float voltsPerAdcVolt=0.0f)
Class for sensors that convert from some raw floating point value (ex: voltage, frequency,...
void setFunction(ConverterType &func)
static float getOrZero(SensorType type)
SensorResult convert(float inputValue) const override
static constexpr persistent_config_s * config
static constexpr engine_configuration_s * engineConfiguration
static FunctionalSensor maf2(SensorType::Maf2, MS2NT(50))
static TableFunc mafCurve(config->mafDecodingBins, config->mafDecoding)
std::remove_extent_t< decltype(config->mafDecodingBins)> BinType
static FuncChain< MafVoltageCheck, MafTable, MafFilter > mafFunction
std::remove_extent_t< decltype(config->mafDecoding)> ValueType
static FunctionalSensor maf(SensorType::Maf, MS2NT(50))
expected< float > SensorResult
virtual SensorResult convert(float raw) const =0
adc_channel_e maf2AdcChannel
adc_channel_e mafAdcChannel
uint16_t mafFilterParameter
float mafDecoding[MAF_DECODING_COUNT]
float mafDecodingBins[MAF_DECODING_COUNT]
static tstrWifiInitParam param