xref: /openbmc/phosphor-pid-control/pid/pidloop.hpp (revision ce6a3f36cedc2f822fb446bc5094eaeab47eb4af)
1*ce6a3f36SJames Feist #pragma once
2*ce6a3f36SJames Feist 
3*ce6a3f36SJames Feist #include "pid/zone.hpp"
4*ce6a3f36SJames Feist 
5*ce6a3f36SJames Feist #include <boost/asio/steady_timer.hpp>
6*ce6a3f36SJames Feist 
7*ce6a3f36SJames Feist /**
8*ce6a3f36SJames Feist  * Main pid control loop for a given zone.
9*ce6a3f36SJames Feist  * This function calls itself indefinitely in an async loop to calculate
10*ce6a3f36SJames Feist  * fan outputs based on thermal inputs.
11*ce6a3f36SJames Feist  *
12*ce6a3f36SJames Feist  * @param[in] zone - ptr to the PIDZone for this loop.
13*ce6a3f36SJames Feist  * @param[in] timer - boost timer used for async callback.
14*ce6a3f36SJames Feist  * @param[in] first - boolean to denote if initialization needs to be run.
15*ce6a3f36SJames Feist  * @param[in] ms100cnt - loop timer counter.
16*ce6a3f36SJames Feist  */
17*ce6a3f36SJames Feist void pidControlLoop(PIDZone* zone, boost::asio::steady_timer& timer,
18*ce6a3f36SJames Feist                     bool first = true, int ms100cnt = 0);
19