Implement de-glitch for output overcurrent fault
If three consecutive reads in a row, one second apart, show the fault
on, create and log an error.
Change-Id: I0a51241ac00514c50fac49c050cf5bf086ca9ab4
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/power-supply/power_supply.hpp b/power-supply/power_supply.hpp
index eefefff..5e7bee7 100644
--- a/power-supply/power_supply.hpp
+++ b/power-supply/power_supply.hpp
@@ -165,12 +165,12 @@
bool inputFault = false;
/**
- * @brief Set to true when an output over current fault is detected
+ * @brief Indicates output over current fault if equal to FAULT_COUNT
*
- * This is the "IOUT_OC_FAULT" bit in the low byte from the STATUS_WORD
- * command response.
+ * @details This is incremented when the "IOUT_OC_FAULT" bit in the low
+ * byte from the STATUS_WORD command response is on.
*/
- bool outputOCFault = false;
+ size_t outputOCFault = 0;
/**
* @brief Set to true when the output overvoltage fault is detected