diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-02-19 12:07:30 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-02-19 12:20:00 -0500 |
commit | 804f95ebe4961566603747165ec90a1676a0dc7d (patch) | |
tree | 7461ff95946ada095242460618323e1d511e8c07 /klippy/homing.py | |
parent | fbbbbc85cf6b717a48c9c62cd39a219af0223655 (diff) | |
download | kutter-804f95ebe4961566603747165ec90a1676a0dc7d.tar.gz kutter-804f95ebe4961566603747165ec90a1676a0dc7d.tar.xz kutter-804f95ebe4961566603747165ec90a1676a0dc7d.zip |
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 <kevin@koconnor.net>
Diffstat (limited to 'klippy/homing.py')
-rw-r--r-- | klippy/homing.py | 8 |
1 files changed, 3 insertions, 5 deletions
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()) |