bed_screws: Reset on move error

Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
This commit is contained in:
Pedro Lamas 2023-11-01 01:14:44 +00:00 committed by KevinOConnor
parent 233f50424c
commit 9e765daeed
1 changed files with 6 additions and 1 deletions

View File

@ -42,7 +42,12 @@ class BedScrews:
self.current_screw = 0
self.accepted_screws = 0
def move(self, coord, speed):
self.printer.lookup_object('toolhead').manual_move(coord, speed)
try:
self.printer.lookup_object('toolhead').manual_move(coord, speed)
except self.printer.command_error as e:
self.unregister_commands()
self.reset()
raise
def move_to_screw(self, state, screw):
# Move up, over, and then down
self.move((None, None, self.horizontal_move_z), self.lift_speed)