50 if (rpm < engineConfiguration->cranking.rpm) {
92 if (mult != 0 && (mult < 0.01 || mult > 100)) {
121 static const floatms_t smallEpsilon = 0.001f;
133 int len = minI(
cb.getSize(),
cb.getCount());
138 int ci =
cb.currentIndex - 1;
139 float maxValue =
cb.get(ci) -
cb.get(ci - 1);
140 int resultIndex = ci;
145 for (
int i = 1; i<len - 1;i++) {
146 float v =
cb.get(ci - i) -
cb.get(ci - i - 1);
149 resultIndex = ci - i;
159 return (
cb.get(index) - (
cb.get(index - 1)));
181 cb.add(currentValue);
215 constexpr float slowCallbackPeriodSecond = SLOW_CALLBACK_PERIOD_MS / 1000.0f;
219 efiPrintf(
"setTpsAccelLen: Length should be positive [%d]", length);
void initAccelEnrichment()
Acceleration enrichment calculator.
constexpr auto & module()
static float getOrZero(SensorType type)
int onUpdateInvocationCounter
bool isAccelEventTriggered()
void onConfigurationChange(engine_configuration_s const *previousConfig) override
bool m_accelEventJustOccurred
float getTimeSinceAcell() const
floatms_t getTpsEnrichment()
void resetFractionValues()
cyclic_buffer< float > cb
void onNewValue(float currentValue)
void setLength(int length)
static EngineAccessor engine
static constexpr persistent_config_s * config
static constexpr engine_configuration_s * engineConfiguration
float tpsDecelEnleanmentThreshold
accel_enrichment_mode_e accelEnrichmentMode
float tpsAccelFractionDivisor
float tpsAccelEnrichmentThreshold
scaled_channel< uint8_t, 20, 1 > tpsAccelLookback
int16_t tpsAccelFractionPeriod
float tpsDecelEnleanmentMultiplier
float tpsTpsAccelTable[TPS_TPS_ACCEL_TABLE][TPS_TPS_ACCEL_TABLE]
scaled_channel< uint8_t, 1, 50 > tpsTspCorrValuesBins[TPS_TPS_ACCEL_CLT_CORR_TABLE]
float tpsTpsAccelFromRpmBins[TPS_TPS_ACCEL_TABLE]
scaled_channel< uint8_t, 50, 1 > tpsTspCorrValues[TPS_TPS_ACCEL_CLT_CORR_TABLE]
float tpsTpsAccelToRpmBins[TPS_TPS_ACCEL_TABLE]
floatms_t maxInjectedPerPeriod
bool isAboveAccelThreshold
bool isBelowDecelThreshold
floatms_t maxExtraPerPeriod
bool isTimeToResetAccumulator
floatms_t accumulatedValue
bool isFractionalEnrichment
floatms_t maxExtraPerCycle