add tuning enable variable
Add a variable that when set, enables tuning logging. This variable is
set to false.
Tuning can be enabled via "-t" "--tuning" on the command line.
With a parameter is the path where to write the logging information.
Change-Id: I6eb8035d56cc3301face21e9375c02fc9fcc5b31
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/pid/fancontroller.cpp b/pid/fancontroller.cpp
index 4a61def..4c1b56b 100644
--- a/pid/fancontroller.cpp
+++ b/pid/fancontroller.cpp
@@ -16,6 +16,7 @@
#include "fancontroller.hpp"
+#include "tuning.hpp"
#include "util.hpp"
#include "zone.hpp"
@@ -115,16 +116,17 @@
double percent = value;
/* If doing tuning logging, don't go into failsafe mode. */
-#ifndef __TUNING_LOGGING__
- if (_owner->getFailSafeMode())
+ if (!tuningLoggingEnabled)
{
- /* In case it's being set to 100% */
- if (percent < _owner->getFailSafePercent())
+ if (_owner->getFailSafeMode())
{
- percent = _owner->getFailSafePercent();
+ /* In case it's being set to 100% */
+ if (percent < _owner->getFailSafePercent())
+ {
+ percent = _owner->getFailSafePercent();
+ }
}
}
-#endif
// value and kFanFailSafeDutyCycle are 10 for 10% so let's fix that.
percent /= 100;