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:
Kevin O'Connor 2024-05-19 13:15:30 -04:00
parent 4709f1fad5
commit 37482178b5
4 changed files with 24 additions and 14 deletions

View file

@ -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():