From 38247d6fcf7f354793b50f3bc03254323c0bd5cb Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 28 May 2017 22:10:35 -0400 Subject: [PATCH] progress --- firmware/controllers/math/pid.cpp | 5 +++++ firmware/controllers/math/pid.h | 1 + 2 files changed, 6 insertions(+) diff --git a/firmware/controllers/math/pid.cpp b/firmware/controllers/math/pid.cpp index 9e0c0f869b..101cef2a90 100644 --- a/firmware/controllers/math/pid.cpp +++ b/firmware/controllers/math/pid.cpp @@ -118,6 +118,11 @@ void Pid::postState(TunerStudioOutputChannels *tsOutputChannels) { } #endif +void Pid::sleep() { + int period = maxI(10, 10); + chThdSleepMilliseconds(period); +} + void Pid::showPidStatus(Logging *logging, const char*msg, int dTime) { // todo: dTime should be taken from pid_s scheduleMsg(logging, "%s o=%f P=%.5f I=%.5f D=%.5f dT=%d", diff --git a/firmware/controllers/math/pid.h b/firmware/controllers/math/pid.h index a7d458067c..67c7078729 100644 --- a/firmware/controllers/math/pid.h +++ b/firmware/controllers/math/pid.h @@ -43,6 +43,7 @@ public: float iTerm; float dTerm; // we are remembering this only for debugging purposes void showPidStatus(Logging *logging, const char*msg, int dTime); + void sleep(); private: pid_s *pid;