diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-11-10 11:55:53 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-11-10 11:55:53 -0500 |
commit | f50e054bd069a0e7ae9455dfa5ddfc6894c4789e (patch) | |
tree | 339a8ace3f3272629321eb51bd7c8c70c459700a /klippy/extras/stepper_enable.py | |
parent | 064804b68867a83fd77f687b2f504069b74de771 (diff) | |
download | kutter-f50e054bd069a0e7ae9455dfa5ddfc6894c4789e.tar.gz kutter-f50e054bd069a0e7ae9455dfa5ddfc6894c4789e.tar.xz kutter-f50e054bd069a0e7ae9455dfa5ddfc6894c4789e.zip |
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>
Diffstat (limited to 'klippy/extras/stepper_enable.py')
-rw-r--r-- | klippy/extras/stepper_enable.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/klippy/extras/stepper_enable.py b/klippy/extras/stepper_enable.py new file mode 100644 index 00000000..5d9e6a41 --- /dev/null +++ b/klippy/extras/stepper_enable.py @@ -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) |