Fix threshold checks

With the previous code, if the alarm was already set and the value was
still above the threshold, then the statement
    if (!alarmHigh && value >= threshold->high() || alarmHigh)

would pass due to the '|| alarmHigh' but the code inside that block
would then think the alarm should deassert.  This commit adds code to
also check if the value is below the high threshold if the alarmHigh is
set, and does a similar check for the alarmLow section.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I673de7154959133d48c524b85a680e7d523aa6a5
1 file changed