diff --git a/firmware/controllers/actuators/idle_thread.cpp b/firmware/controllers/actuators/idle_thread.cpp index 9f0b208309..b8e68a6b7f 100644 --- a/firmware/controllers/actuators/idle_thread.cpp +++ b/firmware/controllers/actuators/idle_thread.cpp @@ -148,7 +148,7 @@ percent_t IdleController::getOpenLoop(Phase phase, float rpm, float clt, SensorR return interpolate2d(rpm, config->iacCoastingRpmBins, config->iacCoasting); } - percent_t running = getRunningOpenLoop(IIdleController::Phase::Cranking, rpm, clt, tps); + percent_t running = getRunningOpenLoop(phase, rpm, clt, tps); // Interpolate between cranking and running over a short time // This clamps once you fall off the end, so no explicit check for >1 required diff --git a/unit_tests/tests/test_idle_controller.cpp b/unit_tests/tests/test_idle_controller.cpp index 17c01e9b43..3143909745 100644 --- a/unit_tests/tests/test_idle_controller.cpp +++ b/unit_tests/tests/test_idle_controller.cpp @@ -251,7 +251,8 @@ TEST(idle_v2, openLoopRunningTaper) { EngineTestHelper eth(engine_type_e::TEST_ENGINE); StrictMock dut; - EXPECT_CALL(dut, getRunningOpenLoop(IIdleController::Phase::Cranking, 0, 30, SensorResult(0))).WillRepeatedly(Return(25)); + EXPECT_CALL(dut, getRunningOpenLoop(IIdleController::Phase::CrankToIdleTaper, 0, 30, SensorResult(0))).WillRepeatedly(Return(25)); + EXPECT_CALL(dut, getRunningOpenLoop(IIdleController::Phase::Running, 0, 30, SensorResult(0))).WillRepeatedly(Return(25)); EXPECT_CALL(dut, getCrankingOpenLoop(30)).WillRepeatedly(Return(75)); // 0 cycles - no taper yet, pure cranking value