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); } /**