mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-11 16:57:55 -06:00
stepper_enable: Add new extras module for stepper enable line tracking
Move the M18/M84 command handling from gcode.py to new stepper_enable module. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
064804b688
commit
f50e054bd0
3 changed files with 23 additions and 5 deletions
20
klippy/extras/stepper_enable.py
Normal file
20
klippy/extras/stepper_enable.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Support for enable pins on stepper motor drivers
|
||||
#
|
||||
# Copyright (C) 2019 Kevin O'Connor <kevin@koconnor.net>
|
||||
#
|
||||
# This file may be distributed under the terms of the GNU GPLv3 license.
|
||||
|
||||
class StepperEnable:
|
||||
def __init__(self, config):
|
||||
self.printer = config.get_printer()
|
||||
# Register M18/M84 commands
|
||||
gcode = self.printer.lookup_object('gcode')
|
||||
gcode.register_command("M18", self.cmd_M18)
|
||||
gcode.register_command("M84", self.cmd_M18)
|
||||
def cmd_M18(self, params):
|
||||
# Turn off motors
|
||||
toolhead = self.printer.lookup_object('toolhead')
|
||||
toolhead.motor_off()
|
||||
|
||||
def load_config(config):
|
||||
return StepperEnable(config)
|
Loading…
Add table
Add a link
Reference in a new issue