blob: 3a67954812bc1ac5918ada5664dd3bf76b3d01f2 [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
7/**
8 * Main pid control loop for a given zone.
9 * This function calls itself indefinitely in an async loop to calculate
10 * fan outputs based on thermal inputs.
11 *
12 * @param[in] zone - ptr to the PIDZone for this loop.
13 * @param[in] timer - boost timer used for async callback.
14 * @param[in] first - boolean to denote if initialization needs to be run.
15 * @param[in] ms100cnt - loop timer counter.
16 */
17void pidControlLoop(PIDZone* zone, boost::asio::steady_timer& timer,
18 bool first = true, int ms100cnt = 0);