From bfb34e07017248268474281dc6678a8d141458ad Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 12 Nov 2019 11:41:41 -0500 Subject: stepper_enable: Move motor_off() logic to stepper_enable.py Directly disable all the stepper motors on a global motor_off() from the StepperEnable() class in stepper_enable.py. This simplifies the toolhead and kinematic classes. Signed-off-by: Kevin O'Connor --- klippy/kinematics/corexy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'klippy/kinematics/corexy.py') diff --git a/klippy/kinematics/corexy.py b/klippy/kinematics/corexy.py index 9f9df91b..2c041a79 100644 --- a/klippy/kinematics/corexy.py +++ b/klippy/kinematics/corexy.py @@ -20,6 +20,8 @@ class CoreXYKinematics: for s in self.get_steppers(): s.set_trapq(toolhead.get_trapq()) toolhead.register_step_generator(s.generate_steps) + config.get_printer().register_event_handler("stepper_enable:motor_off", + self._motor_off) # Setup boundary checks max_velocity, max_accel = toolhead.get_max_velocity() self.max_z_velocity = config.getfloat( @@ -63,10 +65,8 @@ class CoreXYKinematics: forcepos[axis] += 1.5 * (position_max - hi.position_endstop) # Perform homing homing_state.home_rails([rail], forcepos, homepos) - def motor_off(self, print_time): + def _motor_off(self, print_time): self.limits = [(1.0, -1.0)] * 3 - for rail in self.rails: - rail.motor_enable(print_time, 0) def _check_endstops(self, move): end_pos = move.end_pos for i in (0, 1, 2): -- cgit v1.2.3-70-g09d2