From d3951070f95ffe1ec5e4505c58387edb63206b8a Mon Sep 17 00:00:00 2001 From: Anthony Carapetis Date: Sat, 21 Apr 2018 01:10:15 +1000 Subject: [PATCH] Fix watchdog ping timing The time comparison in ping_watchdog_and_depulse was backwards, causing the speed to be set every [sleeptime] seconds regardless of watchdog_. This is probably not an issue for most users, but on my hardware setting the speed causes the fan to momentarily shut off, so this bug was causing the fan to ramp up and down every five seconds. --- src/drivers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers.cpp b/src/drivers.cpp index c475ae7..ea1d90b 100644 --- a/src/drivers.cpp +++ b/src/drivers.cpp @@ -144,7 +144,7 @@ void TpFanDriver::ping_watchdog_and_depulse(const Level *level) std::this_thread::sleep_for(depulse_); set_speed(level); } - else if (last_watchdog_ping_ + watchdog_ + sleeptime >= std::chrono::system_clock::now()) + else if (last_watchdog_ping_ + watchdog_ + sleeptime <= std::chrono::system_clock::now()) set_speed(level); }