Launch control bug? "range" thing is confusing #4348

refactoring: reducing confusion
This commit is contained in:
rusefillc 2022-07-20 18:24:36 -04:00
parent 8213252f45
commit f9ba8bf82c
1 changed files with 2 additions and 2 deletions

View File

@ -66,10 +66,10 @@ static angle_t getRunningAdvance(int rpm, float engineLoad) {
if (engine->launchController.isLaunchCondition && engineConfiguration->enableLaunchRetard) { if (engine->launchController.isLaunchCondition && engineConfiguration->enableLaunchRetard) {
if (engineConfiguration->launchSmoothRetard) { if (engineConfiguration->launchSmoothRetard) {
float launchAngle = engineConfiguration->launchTimingRetard; float launchAngle = engineConfiguration->launchTimingRetard;
int launchAdvanceRpmRange = engineConfiguration->launchTimingRpmRange; int launchRpmWithTimingRange = launchRpm + engineConfiguration->launchTimingRpmRange;
int launchRpm = engineConfiguration->launchRpm; int launchRpm = engineConfiguration->launchRpm;
// interpolate timing from rpm at launch triggered to full retard at launch launchRpm + launchTimingRpmRange // interpolate timing from rpm at launch triggered to full retard at launch launchRpm + launchTimingRpmRange
return interpolateClamped(launchRpm, advanceAngle, (launchRpm + launchAdvanceRpmRange), launchAngle, rpm); return interpolateClamped(launchRpm, advanceAngle, launchRpmWithTimingRange, launchAngle, rpm);
} else { } else {
return engineConfiguration->launchTimingRetard; return engineConfiguration->launchTimingRetard;
} }