From e786748f18b6b004e7fe999004abb5b308e62417 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 15 Dec 2020 12:21:04 -0500 Subject: [PATCH] heaters: Always register heater pin as a pwm pin There's no need to sometimes register the pin as a 'digital_out' pin instead of as a 'pwm' pin. Signed-off-by: Kevin O'Connor --- klippy/extras/heaters.py | 11 ++++------- klippy/mcu.py | 2 -- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/klippy/extras/heaters.py b/klippy/extras/heaters.py index cd426f30..840bbfd5 100644 --- a/klippy/extras/heaters.py +++ b/klippy/extras/heaters.py @@ -49,13 +49,10 @@ class Heater: # Setup output heater pin heater_pin = config.get('heater_pin') ppins = self.printer.lookup_object('pins') - if algo is ControlBangBang and self.max_power == 1.: - self.mcu_pwm = ppins.setup_pin('digital_out', heater_pin) - else: - self.mcu_pwm = ppins.setup_pin('pwm', heater_pin) - pwm_cycle_time = config.getfloat( - 'pwm_cycle_time', 0.100, above=0., maxval=self.pwm_delay) - self.mcu_pwm.setup_cycle_time(pwm_cycle_time) + self.mcu_pwm = ppins.setup_pin('pwm', heater_pin) + pwm_cycle_time = config.getfloat('pwm_cycle_time', 0.100, above=0., + maxval=self.pwm_delay) + self.mcu_pwm.setup_cycle_time(pwm_cycle_time) self.mcu_pwm.setup_max_duration(MAX_HEAT_TIME) # Load additional modules self.printer.load_object(config, "verify_heater %s" % (self.name,)) diff --git a/klippy/mcu.py b/klippy/mcu.py index 6e8149a6..e9a7a74a 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -161,8 +161,6 @@ class MCU_digital_out: self._set_cmd.send([self._oid, clock, (not not value) ^ self._invert], minclock=self._last_clock, reqclock=clock) self._last_clock = clock - def set_pwm(self, print_time, value, cycle_time=None): - self.set_digital(print_time, value >= 0.5) class MCU_pwm: def __init__(self, mcu, pin_params):