Stop the timer when the deasserted events occur
A timer will be started if there is any threshold asserted event occurs,
but it is not stopped when the deasserted occurs.
This causes additional asserted events.
Connected the timer with different threshold, and stop it if deasserted.
Tested:
Adjust the threshold value with ipmitool raw 4 0x26 command, there is no duplicated asserted sel log:
8 | 04/21/20 | 08:00:24 UTC | Voltage P3VBAT | Upper Non-critical going high | Asserted | Reading 3.04 > Threshold 2.57 Volts
9 | 04/21/20 | 08:00:26 UTC | Voltage P3VBAT | Upper Non-critical going high | Deasserted | Reading 3.04 > Threshold 3.28 Volts
a | 04/21/20 | 08:00:45 UTC | Voltage P3VBAT | Upper Non-critical going high | Asserted | Reading 3.04 > Threshold 2.57 Volts
b | 04/21/20 | 08:00:48 UTC | Voltage P3VBAT | Upper Non-critical going high | Deasserted | Reading 3.04 > Threshold 3.28 Volts
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
Change-Id: Ia218320c29c34e0bf9ef0604934e04cf0a5701dd
diff --git a/src/Thresholds.cpp b/src/Thresholds.cpp
index 965b626..dd6b7ca 100644
--- a/src/Thresholds.cpp
+++ b/src/Thresholds.cpp
@@ -348,6 +348,7 @@
}
else
{
+ thresholdTimer.stopTimer(threshold);
assertThresholds(sensor, threshold.level, threshold.direction,
false);
}