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 <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2020-12-15 12:21:04 -05:00
parent 0bebdf11c2
commit e786748f18
2 changed files with 4 additions and 9 deletions

View File

@@ -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,))