aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/heater_fan.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-12-01 12:31:22 -0500
committerKevin O'Connor <kevin@koconnor.net>2020-12-01 12:31:22 -0500
commita4f7ad9ffce68aaa84481083b045b29180e1435e (patch)
treeb6a8eb6ea6483abaabfc761cf2aef0f69b4281c1 /klippy/extras/heater_fan.py
parentf261a4688b07535c58847790a8d203dd3f1c7a88 (diff)
downloadkutter-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/heater_fan.py')
-rw-r--r--klippy/extras/heater_fan.py11
1 files changed, 5 insertions, 6 deletions
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):