commit | 6e6ac0f850e94c4729456c41ba53f5a84437e59b | [log] [tgz] |
---|---|---|
author | Josh Lehan <krellan@google.com> | Wed Dec 30 22:32:57 2020 -0800 |
committer | Josh Lehan <krellan@google.com> | Sun Jan 10 07:48:16 2021 -0800 |
tree | c0d50f3f7641f2df30d12d7fea4eb8e4ee822d9c | |
parent | 6736d4b2a77cec00a8919f26035176c8b8025a4d [diff] |
dbus-sensors: PwmSensor math types cleanup Cleaned up types during math to avoid precision loss. Integer pwmMax and associated constants now double. Avoid floating-point comparison, convert to int first. Corrected rounding from float to int. Property setter now ignores floating-point NaN. Rounding done more consistently and correctly now. In some edge cases, the fan PWM setting will be different from what it was before, because rounding is now proper instead of truncating. Tested: Swept fans from 0.0 to 100.0 percent, stepping by 0.1 each time, to exercise all values between 0 and 255. Behavior now seems more correct to me. Also set NaN, and it was properly ignored. Also tested on the uint64_t interface, swept from 0 to 255, each value mapped cleanly to equivalent floating-point value. Not tested on "PSU" fans. These are a special case, as the integers in the underlying file range from 0 to 100, not 0 to 255. The original logic to handle these remains unchanged, however. Signed-off-by: Josh Lehan <krellan@google.com> Change-Id: Ibc9ad978c1567bb2e7116e00d84e43b4ae22e664
dbus-sensors is a collection of sensor applications that provide the xyz.openbmc_project.Sensor collection of interfaces. They read sensor values from hwmon, d-bus, or direct driver access to provide readings. Some advance non-sensor features such as fan presence, pwm control, and automatic cpu detection (x86) are also supported.
runtime re-configurable from d-bus (entity-manager or the like)
isolated: each sensor type is isolated into its own daemon, so a bug in one sensor is unlikely to affect another, and single sensor modifications are possible
async single-threaded: uses sdbusplus/asio bindings
multiple data inputs: hwmon, d-bus, direct driver access