From 804f95ebe4961566603747165ec90a1676a0dc7d Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 19 Feb 2020 12:07:30 -0500 Subject: homing: Don't raise a TimeoutError from home_wait() Change home_wait() to return if the homing operation completed succesfully or not. This simplifies the callers. Signed-off-by: Kevin O'Connor --- klippy/homing.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'klippy/homing.py') diff --git a/klippy/homing.py b/klippy/homing.py index 6415b115..305c374f 100644 --- a/klippy/homing.py +++ b/klippy/homing.py @@ -71,11 +71,9 @@ class Homing: # Wait for endstops to trigger move_end_print_time = self.toolhead.get_last_move_time() for mcu_endstop, name in endstops: - try: - mcu_endstop.home_wait(move_end_print_time) - except mcu_endstop.TimeoutError as e: - if error is None: - error = "Failed to home %s: %s" % (name, str(e)) + did_trigger = mcu_endstop.home_wait(move_end_print_time) + if not did_trigger and error is None: + error = "Failed to home %s: Timeout during homing" % (name,) # Determine stepper halt positions self.toolhead.flush_step_generation() end_mcu_pos = [(s, name, spos, s.get_mcu_position()) -- cgit v1.2.3-70-g09d2