From 27fccf0a7f106f1cfbc20027dd15bd472858c959 Mon Sep 17 00:00:00 2001 From: andreika-git Date: Sat, 31 Aug 2019 22:38:01 +0300 Subject: [PATCH] mightResetPid docs (#912) --- firmware/controllers/actuators/idle_thread.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firmware/controllers/actuators/idle_thread.cpp b/firmware/controllers/actuators/idle_thread.cpp index 0833e34e44..721c377959 100644 --- a/firmware/controllers/actuators/idle_thread.cpp +++ b/firmware/controllers/actuators/idle_thread.cpp @@ -51,7 +51,10 @@ EXTERN_ENGINE ; static bool shouldResetPid = false; -// we might reset PID state when the state is changed, but only if needed (See autoIdle()) +// The idea of 'mightResetPid' is to reset PID only once - each time when TPS > idlePidDeactivationTpsThreshold. +// The throttle pedal can be pressed for a long time, making the PID data obsolete (thus the reset is required). +// We set 'mightResetPid' to true only if PID was actually used (i.e. idlePid.getOutput() was called) to save some CPU resources. +// See automaticIdleController(). static bool mightResetPid = false; #if EFI_IDLE_INCREMENTAL_PID_CIC