From a7e047489c4fc0136c7e8b8e381ee4a00bea8779 Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 3 Sep 2019 21:45:42 -0400 Subject: [PATCH] BUGFIX: ETB idle should care about pedal position, not TPS position --- firmware/controllers/actuators/idle_thread.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/firmware/controllers/actuators/idle_thread.cpp b/firmware/controllers/actuators/idle_thread.cpp index 9b26c58ddc..8d877107bb 100644 --- a/firmware/controllers/actuators/idle_thread.cpp +++ b/firmware/controllers/actuators/idle_thread.cpp @@ -182,13 +182,19 @@ static void undoIdleBlipIfNeeded() { } static bool isOutOfAutomaticIdleCondition(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - percent_t tpsPos = getTPS(PASS_ENGINE_PARAMETER_SIGNATURE); - - if (CONFIG(throttlePedalUpPin) != GPIO_UNASSIGNED) + if (CONFIG(throttlePedalUpPin) != GPIO_UNASSIGNED) { return !engine->engineState.idle.throttlePedalUpState; + } - return tpsPos > CONFIGB(idlePidDeactivationTpsThreshold); + percent_t inputPosition; + if (hasPedalPositionSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) { + inputPosition = getPedalPosition(PASS_ENGINE_PARAMETER_SIGNATURE); + } else { + inputPosition = getTPS(PASS_ENGINE_PARAMETER_SIGNATURE); + } + + return inputPosition > CONFIGB(idlePidDeactivationTpsThreshold); } /**