Init zone target speed to current target speed
Whenever fan control (control mode) is started, the target speed for
each zone should be initialized to the currently set target speed.
In the case where a watchdog has triggered the fans to full speed
and the target speed does not reflect this, the proper set of set speed
events should be configured. In this case, an event could be defined to
use the current tach feedback to adjust the target speed prior to
account for the real state of the fan speeds.
Change-Id: I538644ffc83a6e01469174304d393c889038d066
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/fan.hpp b/control/fan.hpp
index e23d44e..6975248 100644
--- a/control/fan.hpp
+++ b/control/fan.hpp
@@ -46,6 +46,16 @@
*/
void setSpeed(uint64_t speed);
+ /**
+ * @brief Get the current fan target speed
+ *
+ * @return - The target speed of the fan
+ */
+ inline auto getTargetSpeed() const
+ {
+ return _targetSpeed;
+ }
+
private:
/**
@@ -71,6 +81,11 @@
* Vector of hwmon sensors for the rotors
*/
std::vector<std::string> _sensors;
+
+ /**
+ * Target speed for this fan
+ */
+ uint64_t _targetSpeed;
};