Update tachometer.cpp - fix tach sweep (#483)

fix tachsweep - x2 and y2 transposed in interpolateClamped
This commit is contained in:
DenisMitchell 2024-09-05 14:44:32 -04:00 committed by GitHub
parent 20333f9ddb
commit 28c7b9efc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -78,11 +78,11 @@ float TachometerModule::getRpm() {
return trueRpm;
} else if (sweepPosition < 0.5f) {
// First half of the ramp, ramp up from 0 -> max
return interpolateClamped(0, 0.5f, 0, engineConfiguration->tachSweepMax, sweepPosition);
return interpolateClamped(0, 0, 0.5f, engineConfiguration->tachSweepMax, sweepPosition);
} else {
// Use y2 = trueRpm instead of 0 so that it ramps back down smoothly
// to the current RPM if the engine started during ther ramp
return interpolateClamped(0.5f, 1, engineConfiguration->tachSweepMax, trueRpm, sweepPosition);
return interpolateClamped(0.5f, engineConfiguration->tachSweepMax, 1, trueRpm, sweepPosition);
}
}