From cd028fd7227ea3aab8e2bd3d16a17e6d276b151b Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 3 Jun 2017 10:37:26 -0400 Subject: [PATCH] PID reset counter for all! --- firmware/controllers/alternatorController.cpp | 4 ---- firmware/controllers/math/pid.cpp | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/firmware/controllers/alternatorController.cpp b/firmware/controllers/alternatorController.cpp index 5e4cfda893..99d7a06719 100644 --- a/firmware/controllers/alternatorController.cpp +++ b/firmware/controllers/alternatorController.cpp @@ -25,8 +25,6 @@ EXTERN_ENGINE static Logging *logger; -int alternatorPidResetCounter = 0; - static SimplePwm alternatorControl; static pid_s *altPidS = &persistentState.persistentConfiguration.engineConfiguration.alternatorControl; static Pid altPid(altPidS); @@ -53,7 +51,6 @@ static msg_t AltCtrlThread(int param) { #if ! EFI_UNIT_TEST || defined(__DOXYGEN__) if (shouldResetPid) { pidReset(); - alternatorPidResetCounter++; shouldResetPid = false; } #endif @@ -65,7 +62,6 @@ static msg_t AltCtrlThread(int param) { // this block could be executed even in on/off alternator control mode // but at least we would reflect latest state altPid.postState(&tsOutputChannels); - tsOutputChannels.debugIntField3 = alternatorPidResetCounter; } #endif /* !EFI_UNIT_TEST */ diff --git a/firmware/controllers/math/pid.cpp b/firmware/controllers/math/pid.cpp index 75e3b3975d..e28585fea8 100644 --- a/firmware/controllers/math/pid.cpp +++ b/firmware/controllers/math/pid.cpp @@ -114,6 +114,7 @@ void Pid::postState(TunerStudioOutputChannels *tsOutputChannels) { tsOutputChannels->debugFloatField7 = pid->maxValue; tsOutputChannels->debugIntField1 = getP(); tsOutputChannels->debugIntField2 = getOffset(); + tsOutputChannels->debugIntField3 = resetCounter; tsOutputChannels->debugFloatField6 = dTerm; } #endif