light refactoring
This commit is contained in:
parent
ede66011e5
commit
9308443f24
|
@ -104,19 +104,17 @@ angle_t getRunningAdvance(int rpm, float engineLoad) {
|
|||
#endif
|
||||
|
||||
#if EFI_LAUNCH_CONTROL
|
||||
if (engineConfiguration->launchControlEnabled) {
|
||||
if (engineConfiguration->enableLaunchRetard) {
|
||||
const float launchAngle = engineConfiguration->launchTimingRetard;
|
||||
const int launchRpm = engineConfiguration->launchRpm;
|
||||
const int smoothRetardStartRpm = (launchRpm - engineConfiguration->launchRpmWindow);
|
||||
const int smoothRetardEndRpm = (launchRpm - engineConfiguration->launchCorrectionsEndRpm);
|
||||
if (smoothRetardStartRpm <= rpm) {
|
||||
if (engineConfiguration->launchSmoothRetard && (rpm <= smoothRetardEndRpm)) {
|
||||
// https://github.com/rusefi/rusefi/issues/5611#issuecomment-2130431696
|
||||
return interpolateClamped(smoothRetardStartRpm, advanceAngle, smoothRetardEndRpm, launchAngle, rpm);
|
||||
} else {
|
||||
return launchAngle;
|
||||
}
|
||||
if (engineConfiguration->launchControlEnabled && engineConfiguration->enableLaunchRetard) {
|
||||
const float launchAngle = engineConfiguration->launchTimingRetard;
|
||||
const int launchRpm = engineConfiguration->launchRpm;
|
||||
const int smoothRetardStartRpm = (launchRpm - engineConfiguration->launchRpmWindow);
|
||||
const int smoothRetardEndRpm = (launchRpm - engineConfiguration->launchCorrectionsEndRpm);
|
||||
if (smoothRetardStartRpm <= rpm) {
|
||||
if (engineConfiguration->launchSmoothRetard && (rpm <= smoothRetardEndRpm)) {
|
||||
// https://github.com/rusefi/rusefi/issues/5611#issuecomment-2130431696
|
||||
return interpolateClamped(smoothRetardStartRpm, advanceAngle, smoothRetardEndRpm, launchAngle, rpm);
|
||||
} else {
|
||||
return launchAngle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue