From 5002dda37ce81dbccb58225723ebc0c5c57375bf Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 29 Mar 2021 10:45:59 -0400 Subject: [PATCH] homing: Move home_axes() into cmd_G28() Signed-off-by: Kevin O'Connor --- klippy/extras/homing.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/klippy/extras/homing.py b/klippy/extras/homing.py index 89327e4c..972e3029 100644 --- a/klippy/extras/homing.py +++ b/klippy/extras/homing.py @@ -143,13 +143,6 @@ class Homing: for axis in homing_axes: movepos[axis] = adjustpos[axis] self.toolhead.set_position(movepos) - def home_axes(self, axes): - self.changed_axes = axes - try: - self.toolhead.get_kinematics().home(self) - except self.printer.command_error: - self.printer.lookup_object('stepper_enable').motor_off() - raise # Return a completion that completes when all completions in a list complete def multi_complete(printer, completions): @@ -178,7 +171,13 @@ class PrinterHoming: if not axes: axes = [0, 1, 2] homing_state = Homing(self.printer) - homing_state.home_axes(axes) + homing_state.set_axes(axes) + kin = self.printer.lookup_object('toolhead').get_kinematics() + try: + kin.home(homing_state) + except self.printer.command_error: + self.printer.lookup_object('stepper_enable').motor_off() + raise def load_config(config): return PrinterHoming(config)