stepper: Simplify helper module registration of stepper motors

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-07-19 13:22:40 -04:00
parent c632b377ca
commit f0dbeb0493
3 changed files with 10 additions and 13 deletions

View file

@ -84,10 +84,10 @@ class PrinterStepperEnable:
gcode.register_command("SET_STEPPER_ENABLE",
self.cmd_SET_STEPPER_ENABLE,
desc=self.cmd_SET_STEPPER_ENABLE_help)
def register_stepper(self, stepper, pin):
name = stepper.get_name()
enable = setup_enable_pin(self.printer, pin)
self.enable_lines[name] = EnableTracking(stepper, enable)
def register_stepper(self, config, mcu_stepper):
name = mcu_stepper.get_name()
enable = setup_enable_pin(self.printer, config.get('enable_pin', None))
self.enable_lines[name] = EnableTracking(mcu_stepper, enable)
def motor_off(self):
toolhead = self.printer.lookup_object('toolhead')
toolhead.dwell(DISABLE_STALL_TIME)