Changing wording of failsafe transition messages
Cleaning up and unifying the logic around displaying diagnostic
messages when failsafe transitions happen, so that the true case and
the false case run the same code path. This makes the messaging more
standard and coherent from the user point of view.
This will cause one additional logging message to appear during
startup. This is intentional: when the process is started up, this
counts as a state transition that is worth logging about, as it goes
from uncontrolled state (essentially manual mode) to either failsafe
mode or normal mode.
Tested: Installed and observed messages logged during startup
Change-Id: Ib80cc342611a78199410564f76a2c65b590ef511
Signed-off-by: Josh Lehan <krellan@google.com>
diff --git a/pid/fancontroller.hpp b/pid/fancontroller.hpp
index 89b3d5e..447ce7b 100644
--- a/pid/fancontroller.hpp
+++ b/pid/fancontroller.hpp
@@ -47,7 +47,10 @@
private:
std::vector<std::string> _inputs;
FanSpeedDirection _direction;
- bool failsafePrint = true;
+
+ // Cosmetic only, to reduce frequency of repetitive messages
+ bool failsafeTransition = true;
+ bool failsafePrevState = false;
};
} // namespace pid_control