Implement de-glitch for temperature fault or warn
If three consecutive reads in a row, one second apart, show the fault
on, create an log an error.
Change-Id: I9fb1285a01e269beffd2201f5082545748f5bee3
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/power-supply/power_supply.hpp b/power-supply/power_supply.hpp
index b6fcc3a..2723bfe 100644
--- a/power-supply/power_supply.hpp
+++ b/power-supply/power_supply.hpp
@@ -190,9 +190,15 @@
size_t fanFault = 0;
/**
- * @brief Set to true during a temperature fault or warn condition.
+ * @brief Indicates a temperature fault or warn condition was detected
+ * if equal to FAULT_COUNT.
+ *
+ * @details This is incremented when the 'TEMPERATURE_FAULT_WARN' bit
+ * in the STATUS_WORD command response is on, or if the
+ * 'OT_FAULT' bit in the STATUS_TEMPERATURE command response
+ * is on.
*/
- bool temperatureFault = false;
+ size_t temperatureFault = 0;
/**
* @brief Callback for inventory property changes