From 28c7b9efc153f7a856d526f598f5c5a0bc8285d3 Mon Sep 17 00:00:00 2001 From: DenisMitchell <46486778+DenisMitchell@users.noreply.github.com> Date: Thu, 5 Sep 2024 14:44:32 -0400 Subject: [PATCH] Update tachometer.cpp - fix tach sweep (#483) fix tachsweep - x2 and y2 transposed in interpolateClamped --- firmware/controllers/modules/tachometer/tachometer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/modules/tachometer/tachometer.cpp b/firmware/controllers/modules/tachometer/tachometer.cpp index bc96910a88..0fa4deede7 100644 --- a/firmware/controllers/modules/tachometer/tachometer.cpp +++ b/firmware/controllers/modules/tachometer/tachometer.cpp @@ -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); } }