From 3baf6a4acb056acdc762a0cc424de76d8f4efae8 Mon Sep 17 00:00:00 2001 From: andreika-git Date: Thu, 18 Jan 2018 19:11:12 +0200 Subject: [PATCH] Fix startOfCrankingPrimingPulse (#537) --- firmware/controllers/trigger/main_trigger_callback.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp index a0ee213214..17b17e2e5b 100644 --- a/firmware/controllers/trigger/main_trigger_callback.cpp +++ b/firmware/controllers/trigger/main_trigger_callback.cpp @@ -544,10 +544,8 @@ static void startPrimeInjectionPulse(DECLARE_ENGINE_PARAMETER_SIGNATURE) { CONFIG(primeInjFalloffTemperature), 0.0f, ENGINE(sensors.clt)); if (pulseLength > 0) { startSimultaniousInjection(engine); - // todo: why do we round to whole number of milliseconds here? - efitimeus_t turnOffTime = getTimeNowUs() + MS2US((int)efiRound(pulseLength, 1.0f)); - // todo: we have a bug here for sure since 'scheduleTask' does it's own 'getTimeNowUs()' - scheduleTask(sDown, turnOffTime, (schfunc_t) &endSimultaniousInjectionOnlyTogglePins, engine); + efitimeus_t turnOffDelayUs = (efitimeus_t)efiRound(MS2US(pulseLength), 1.0f); + scheduleTask(sDown, turnOffDelayUs, (schfunc_t) &endSimultaniousInjectionOnlyTogglePins, engine); } } // we'll reset it later when the engine starts