From a4f7ad9ffce68aaa84481083b045b29180e1435e Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 1 Dec 2020 12:31:22 -0500 Subject: heater_fan: Fix typo causing excessive cpu usage Commit error introduced in a7e90504 and f261a468. Signed-off-by: Kevin O'Connor --- klippy/extras/controller_fan.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'klippy/extras/controller_fan.py') diff --git a/klippy/extras/controller_fan.py b/klippy/extras/controller_fan.py index 51b15a62..267a2856 100644 --- a/klippy/extras/controller_fan.py +++ b/klippy/extras/controller_fan.py @@ -49,12 +49,11 @@ class ControllerFan: elif self.last_on < self.idle_timeout: speed = self.idle_speed self.last_on += 1 - if speed == self.last_speed: - return - self.last_speed = speed - curtime = self.printer.get_reactor().monotonic() - print_time = self.fan.get_mcu().estimated_print_time(curtime) - self.fan.set_speed(print_time + PIN_MIN_TIME, speed) + if speed != self.last_speed: + self.last_speed = speed + curtime = self.printer.get_reactor().monotonic() + print_time = self.fan.get_mcu().estimated_print_time(curtime) + self.fan.set_speed(print_time + PIN_MIN_TIME, speed) return eventtime + 1. def load_config_prefix(config): -- cgit v1.2.3-70-g09d2