From 2af73d1006befdb9ffbdb43aae3a32b356caea72 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 13 Jul 2018 17:14:33 -0400 Subject: [PATCH] probe: Simplify mcu_probe stepper registration Signed-off-by: Kevin O'Connor --- klippy/extras/probe.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/klippy/extras/probe.py b/klippy/extras/probe.py index 26eaa932..64bddedc 100644 --- a/klippy/extras/probe.py +++ b/klippy/extras/probe.py @@ -43,12 +43,10 @@ class PrinterProbe: self.gcode.register_command( 'QUERY_PROBE', self.cmd_QUERY_PROBE, desc=self.cmd_QUERY_PROBE_help) def build_config(self): - toolhead = self.printer.lookup_object('toolhead') - z_rails = toolhead.get_kinematics().get_rails("Z") - for rail in z_rails: - for mcu_endstop, name in rail.get_endstops(): - for mcu_stepper in mcu_endstop.get_steppers(): - self.mcu_probe.add_stepper(mcu_stepper) + kin = self.printer.lookup_object('toolhead').get_kinematics() + for rail in kin.get_rails("Z"): + for stepper in rail.get_steppers(): + stepper.add_to_endstop(self.mcu_probe) def setup_pin(self, pin_params): if (pin_params['pin'] != 'z_virtual_endstop' or pin_params['type'] != 'endstop'):