Add hysteresis to stepwise controller
Tested-by: Ran on platform monitoring output and wrote
unit test
Change-Id: I74a1d21544c1a9cb4c1cb26dd4a353cbff0442d0
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/pid/ec/stepwise.cpp b/pid/ec/stepwise.cpp
index 4246fb3..4a71532 100644
--- a/pid/ec/stepwise.cpp
+++ b/pid/ec/stepwise.cpp
@@ -16,6 +16,7 @@
#include "stepwise.hpp"
+#include <cmath>
#include <cstddef>
#include <limits>
@@ -29,7 +30,7 @@
for (size_t ii = 1; ii < ec::maxStepwisePoints; ii++)
{
- if (info.reading[ii] == std::numeric_limits<float>::quiet_NaN())
+ if (std::isnan(info.reading[ii]))
{
break;
}