fix (#4254)
This commit is contained in:
parent
ae68ebfb3d
commit
172479e2af
|
@ -92,12 +92,13 @@ void EngineState::periodicFastCallback() {
|
||||||
warning(CUSTOM_SLOW_NOT_INVOKED, "Slow not invoked yet");
|
warning(CUSTOM_SLOW_NOT_INVOKED, "Slow not invoked yet");
|
||||||
}
|
}
|
||||||
efitick_t nowNt = getTimeNowNt();
|
efitick_t nowNt = getTimeNowNt();
|
||||||
|
|
||||||
if (engine->rpmCalculator.isCranking()) {
|
if (engine->rpmCalculator.isCranking()) {
|
||||||
crankingTime = nowNt;
|
crankingTimer.reset(nowNt);
|
||||||
timeSinceCranking = 0.0f;
|
|
||||||
} else {
|
|
||||||
timeSinceCranking = nowNt - crankingTime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
running.timeSinceCrankingInSecs = crankingTimer.getElapsedSeconds(nowNt);
|
||||||
|
|
||||||
recalculateAuxValveTiming();
|
recalculateAuxValveTiming();
|
||||||
|
|
||||||
int rpm = Sensor::getOrZero(SensorType::Rpm);
|
int rpm = Sensor::getOrZero(SensorType::Rpm);
|
||||||
|
@ -114,8 +115,6 @@ void EngineState::periodicFastCallback() {
|
||||||
// post-cranking fuel enrichment.
|
// post-cranking fuel enrichment.
|
||||||
// for compatibility reasons, apply only if the factor is greater than unity (only allow adding fuel)
|
// for compatibility reasons, apply only if the factor is greater than unity (only allow adding fuel)
|
||||||
if (engineConfiguration->postCrankingFactor > 1.0f) {
|
if (engineConfiguration->postCrankingFactor > 1.0f) {
|
||||||
// convert to microsecs and then to seconds
|
|
||||||
running.timeSinceCrankingInSecs = NT2US(timeSinceCranking) / US_PER_SECOND_F;
|
|
||||||
// use interpolation for correction taper
|
// use interpolation for correction taper
|
||||||
running.postCrankingFuelCorrection = interpolateClamped(0.0f, engineConfiguration->postCrankingFactor,
|
running.postCrankingFuelCorrection = interpolateClamped(0.0f, engineConfiguration->postCrankingFactor,
|
||||||
engineConfiguration->postCrankingDurationSec, 1.0f, running.timeSinceCrankingInSecs);
|
engineConfiguration->postCrankingDurationSec, 1.0f, running.timeSinceCrankingInSecs);
|
||||||
|
|
|
@ -30,8 +30,7 @@ public:
|
||||||
|
|
||||||
FuelConsumptionState fuelConsumption;
|
FuelConsumptionState fuelConsumption;
|
||||||
|
|
||||||
efitick_t crankingTime = 0;
|
Timer crankingTimer;
|
||||||
efitick_t timeSinceCranking = 0;
|
|
||||||
|
|
||||||
WarningCodeState warnings;
|
WarningCodeState warnings;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue