now we retard ignition only on pre-launch or launch conditions (#5611)

This commit is contained in:
kifir 2024-06-11 22:22:38 +03:00 committed by rusefillc
parent 9308443f24
commit 7e4b2661d6
2 changed files with 17 additions and 9 deletions

View File

@ -106,6 +106,7 @@ angle_t getRunningAdvance(int rpm, float engineLoad) {
#if EFI_LAUNCH_CONTROL
if (engineConfiguration->launchControlEnabled && engineConfiguration->enableLaunchRetard) {
const float launchAngle = engineConfiguration->launchTimingRetard;
if (engine->launchController.isPreLaunchCondition) {
const int launchRpm = engineConfiguration->launchRpm;
const int smoothRetardStartRpm = (launchRpm - engineConfiguration->launchRpmWindow);
const int smoothRetardEndRpm = (launchRpm - engineConfiguration->launchCorrectionsEndRpm);
@ -117,6 +118,9 @@ angle_t getRunningAdvance(int rpm, float engineLoad) {
return launchAngle;
}
}
} else if (engine->launchController.isLaunchCondition) {
return launchAngle;
}
}
#endif /* EFI_LAUNCH_CONTROL */

View File

@ -77,6 +77,10 @@ static void setUpTestParameters(
} else {
ASSERT_FALSE(engineConfiguration->launchSmoothRetard); // check default value
}
engineConfiguration->launchActivationMode = ALWAYS_ACTIVE_LAUNCH; // to satisfy activateSwitchCondition
engineConfiguration->launchSpeedThreshold = 0; // to satisfy speedCondition
Sensor::setMockValue(SensorType::DriverThrottleIntent, 1.7); // to satisfy tpsCondition
}
static void setUpTestParametersWithEnabledLaunchControl(