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;