diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-12-01 12:31:22 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-12-01 12:31:22 -0500 |
commit | a4f7ad9ffce68aaa84481083b045b29180e1435e (patch) | |
tree | b6a8eb6ea6483abaabfc761cf2aef0f69b4281c1 /klippy/extras | |
parent | f261a4688b07535c58847790a8d203dd3f1c7a88 (diff) | |
download | kutter-a4f7ad9ffce68aaa84481083b045b29180e1435e.tar.gz kutter-a4f7ad9ffce68aaa84481083b045b29180e1435e.tar.xz kutter-a4f7ad9ffce68aaa84481083b045b29180e1435e.zip |
heater_fan: Fix typo causing excessive cpu usage
Commit error introduced in a7e90504 and f261a468.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras')
-rw-r--r-- | klippy/extras/controller_fan.py | 11 | ||||
-rw-r--r-- | klippy/extras/heater_fan.py | 11 |
2 files changed, 10 insertions, 12 deletions
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): diff --git a/klippy/extras/heater_fan.py b/klippy/extras/heater_fan.py index 1294b4d2..43009b06 100644 --- a/klippy/extras/heater_fan.py +++ b/klippy/extras/heater_fan.py @@ -32,12 +32,11 @@ class PrinterHeaterFan: current_temp, target_temp = heater.get_temp(eventtime) if target_temp or current_temp > self.heater_temp: speed = self.fan_speed - 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): |