blob: c8365e3fd909a590d8bd5f639d0acc719390c0df [file] [log] [blame]
James Feistce6a3f32019-03-12 11:20:16 -07001#pragma once
2
3#include "pid/zone.hpp"
4
5#include <boost/asio/steady_timer.hpp>
6
Patrick Venturea0764872020-08-08 07:48:43 -07007namespace pid_control
8{
9
James Feistce6a3f32019-03-12 11:20:16 -070010/**
11 * Main pid control loop for a given zone.
12 * This function calls itself indefinitely in an async loop to calculate
13 * fan outputs based on thermal inputs.
14 *
Patrick Venture597ebd62020-08-11 08:48:19 -070015 * @param[in] zone - ptr to the DbusPidZone for this loop.
James Feistce6a3f32019-03-12 11:20:16 -070016 * @param[in] timer - boost timer used for async callback.
17 * @param[in] first - boolean to denote if initialization needs to be run.
18 * @param[in] ms100cnt - loop timer counter.
19 */
Patrick Venture597ebd62020-08-11 08:48:19 -070020void pidControlLoop(DbusPidZone* zone, boost::asio::steady_timer& timer,
James Feistce6a3f32019-03-12 11:20:16 -070021 bool first = true, int ms100cnt = 0);
Patrick Venturea0764872020-08-08 07:48:43 -070022
23} // namespace pid_control