Implement de-glitch for output overvoltage fault
If three consecutive reads in a row, one second apart, show the fault
on, create and log an error.
Change-Id: I4ab029b24f5afd263ade7eeccca00b34efd99d3e
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/power-supply/power_supply.hpp b/power-supply/power_supply.hpp
index 5e7bee7..ba3a511 100644
--- a/power-supply/power_supply.hpp
+++ b/power-supply/power_supply.hpp
@@ -173,9 +173,12 @@
size_t outputOCFault = 0;
/**
- * @brief Set to true when the output overvoltage fault is detected
+ * @brief Indicates output overvoltage fault if equal to FAULT_COUNT.
+ *
+ * @details This is incremented when the "VOUT_OV_FAULT" bit in the
+ * STATUS_WORD command response is on.
*/
- bool outputOVFault = false;
+ size_t outputOVFault = 0;
/**
* @brief Set to true when a fan fault or warning condition is detected