diff options
author | Raptor Engineering Development Team <support@raptorengineering.com> | 2019-05-10 09:20:31 +0000 |
---|---|---|
committer | Raptor Engineering Development Team <support@raptorengineering.com> | 2019-05-10 09:20:31 +0000 |
commit | 94cf82cce47d5257cf4cf9c02e2ce0565260008e (patch) | |
tree | 7d959a8c1977f66999d5b7f6da0ce7e8b893d98b | |
parent | 54b8ebd8bc9fbf408f438a69c08a10888cb2c0ea (diff) | |
download | phosphor-hwmon-94cf82cce47d5257cf4cf9c02e2ce0565260008e.tar.gz phosphor-hwmon-94cf82cce47d5257cf4cf9c02e2ce0565260008e.zip |
Add new RAWPWM environment variable to set direct PWM mode independent of _enable nodes
-rw-r--r-- | fan_speed.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fan_speed.cpp b/fan_speed.cpp index 0edfea4..8e70437 100644 --- a/fan_speed.cpp +++ b/fan_speed.cpp @@ -19,6 +19,7 @@ uint64_t FanSpeed::target(uint64_t value) auto directPWM = false; auto curValue = FanSpeedObject::target(); auto enable = env::getEnv("ENABLE", _type, _id); + auto rawpwm = env::getEnv("RAWPWM", _type, _id); if (!enable.empty()) { auto val = std::stoul(enable); @@ -27,6 +28,14 @@ uint64_t FanSpeed::target(uint64_t value) directPWM = true; } } + if (!rawpwm.empty()) + { + auto val = std::stoul(rawpwm); + if (val == 1) + { + directPWM = true; + } + } if (curValue != value) { |