summaryrefslogtreecommitdiffstats
path: root/pid/pidloop.hpp
blob: 3a67954812bc1ac5918ada5664dd3bf76b3d01f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#pragma once

#include "pid/zone.hpp"

#include <boost/asio/steady_timer.hpp>

/**
 * Main pid control loop for a given zone.
 * This function calls itself indefinitely in an async loop to calculate
 * fan outputs based on thermal inputs.
 *
 * @param[in] zone - ptr to the PIDZone for this loop.
 * @param[in] timer - boost timer used for async callback.
 * @param[in] first - boolean to denote if initialization needs to be run.
 * @param[in] ms100cnt - loop timer counter.
 */
void pidControlLoop(PIDZone* zone, boost::asio::steady_timer& timer,
                    bool first = true, int ms100cnt = 0);
OpenPOWER on IntegriCloud