Skip to content

Commit

Permalink
fix watchdog ping
Browse files Browse the repository at this point in the history
Commit #d395107 didn't fix the whole issue, we also need to subtract the
sleeptime now instead of adding it. Otherwise we'd always ping the
watchdog sleeptime seconds too late.
Thanks to github user @susanwl for spotting this.
  • Loading branch information
Victor Mataré committed Aug 24, 2018
1 parent 5b5a547 commit fd94d53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/drivers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit fd94d53

Please sign in to comment.