mcu: Raise an error on a failed home_wait() call
Raise a printer.command_error exception if a home_wait() call fails. This makes it easier to support future types of homing errors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -116,7 +116,11 @@ class BLTouchEndstopWrapper:
|
||||
self.mcu_endstop.home_start(self.action_end_time, ENDSTOP_SAMPLE_TIME,
|
||||
ENDSTOP_SAMPLE_COUNT, ENDSTOP_REST_TIME,
|
||||
triggered=triggered)
|
||||
trigger_time = self.mcu_endstop.home_wait(self.action_end_time + 0.100)
|
||||
try:
|
||||
trigger_time = self.mcu_endstop.home_wait(
|
||||
self.action_end_time + 0.100)
|
||||
except self.printer.command_error as e:
|
||||
return False
|
||||
return trigger_time > 0.
|
||||
def raise_probe(self):
|
||||
self.sync_mcu_print_time()
|
||||
|
||||
@@ -98,11 +98,14 @@ class HomingMove:
|
||||
trigger_times = {}
|
||||
move_end_print_time = self.toolhead.get_last_move_time()
|
||||
for mcu_endstop, name in self.endstops:
|
||||
trigger_time = mcu_endstop.home_wait(move_end_print_time)
|
||||
try:
|
||||
trigger_time = mcu_endstop.home_wait(move_end_print_time)
|
||||
except self.printer.command_error as e:
|
||||
if error is None:
|
||||
error = "Error during homing %s: %s" % (name, str(e))
|
||||
continue
|
||||
if trigger_time > 0.:
|
||||
trigger_times[name] = trigger_time
|
||||
elif trigger_time < 0. and error is None:
|
||||
error = "Communication timeout during homing %s" % (name,)
|
||||
elif check_triggered and error is None:
|
||||
error = "No trigger on %s after full movement" % (name,)
|
||||
# Determine stepper halt positions
|
||||
|
||||
@@ -243,8 +243,9 @@ class EddyEndstopWrapper:
|
||||
trigger_time = self._sensor_helper.clear_home()
|
||||
self._stop_measurements(is_home=True)
|
||||
res = self._dispatch.stop()
|
||||
if res == mcu.MCU_trsync.REASON_COMMS_TIMEOUT:
|
||||
return -1.
|
||||
if res >= mcu.MCU_trsync.REASON_COMMS_TIMEOUT:
|
||||
raise self._printer.command_error(
|
||||
"Communication timeout during homing")
|
||||
if res != mcu.MCU_trsync.REASON_ENDSTOP_HIT:
|
||||
return 0.
|
||||
if self._mcu.is_fileoutput():
|
||||
|
||||
Reference in New Issue
Block a user