diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index df5916d0f8..4dc5286dfc 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -151,9 +151,6 @@ public: #if EFI_LAUNCH_CONTROL bool launchActivatePinState = false; bool isLaunchCondition = false; - bool applyLaunchExtraFuel = false; - bool setLaunchBoostDuty = false; - bool applyLaunchControlRetard = false; #endif /* EFI_LAUNCH_CONTROL */ /** diff --git a/firmware/controllers/algo/launch_control.cpp b/firmware/controllers/algo/launch_control.cpp index 22fb755654..579dd02f32 100644 --- a/firmware/controllers/algo/launch_control.cpp +++ b/firmware/controllers/algo/launch_control.cpp @@ -101,7 +101,6 @@ void LaunchControlBase::update() { int rpm = GET_RPM(); bool combinedConditions = isLaunchConditionMet(rpm); - float timeDelay = CONFIG(launchActivateDelay); //recalculate in periodic task, this way we save time in applyLaunchControlLimiting //and still recalculat in case user changed the values @@ -112,21 +111,9 @@ void LaunchControlBase::update() { // conditions not met, reset timer m_launchTimer.reset(); engine->isLaunchCondition = false; - engine->setLaunchBoostDuty = false; - engine->applyLaunchControlRetard = false; - engine->applyLaunchExtraFuel = false; } else { // If conditions are met... - if (m_launchTimer.hasElapsedMs(timeDelay*1000) && combinedConditions) { - engine->isLaunchCondition = true; // ...enable launch! - engine->applyLaunchExtraFuel = true; - } - if (CONFIG(enableLaunchBoost)) { - engine->setLaunchBoostDuty = true; // ...enable boost! - } - if (CONFIG(enableLaunchRetard)) { - engine->applyLaunchControlRetard = true; // ...enable retard! - } + engine->isLaunchCondition = m_launchTimer.hasElapsedSec(CONFIG(launchActivateDelay)); } #if EFI_TUNER_STUDIO @@ -158,7 +145,7 @@ void setDefaultLaunchParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { } void LaunchControlBase::applyLaunchControlLimiting(bool *limitedSpark, bool *limitedFuel DECLARE_ENGINE_PARAMETER_SUFFIX) { - if (( engine->isLaunchCondition ) && ( retardThresholdRpm < GET_RPM() )) { + if (engine->isLaunchCondition && ( retardThresholdRpm < GET_RPM() )) { *limitedSpark = engineConfiguration->launchSparkCutEnable; *limitedFuel = engineConfiguration->launchFuelCutEnable; } diff --git a/firmware/util/timer.cpp b/firmware/util/timer.cpp index 831d6dc83f..a297c84c5a 100644 --- a/firmware/util/timer.cpp +++ b/firmware/util/timer.cpp @@ -11,11 +11,11 @@ void Timer::reset(efitick_t nowNt) { } bool Timer::hasElapsedSec(float seconds) const { - return hasElapsedMs(seconds * 1e3); + return hasElapsedMs(seconds * 1000); } bool Timer::hasElapsedMs(float milliseconds) const { - return hasElapsedUs(milliseconds * 1e3); + return hasElapsedUs(milliseconds * 1000); } bool Timer::hasElapsedUs(float microseconds) const {