BUGFIX: ETB idle should care about pedal position, not TPS position

This commit is contained in:
rusefi 2019-09-03 21:45:42 -04:00
parent 1e96c80980
commit 2e27a94ee7
1 changed files with 10 additions and 4 deletions

View File

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