probe: Be sure to call gcode.reset_last_position() after any manual move

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-06-02 17:24:33 -04:00 committed by KevinOConnor
parent 74cc005ff3
commit bbc8637ed6
1 changed files with 2 additions and 1 deletions

View File

@ -86,6 +86,7 @@ class PrinterProbe:
toolhead.move(curpos, speed)
except homing.EndstopError as e:
raise self.gcode.error(str(e))
self.gcode.reset_last_position()
def _calc_mean(self, positions):
count = float(len(positions))
return [sum([pos[i] for pos in positions]) / count
@ -277,6 +278,7 @@ class ProbePointsHelper:
except homing.EndstopError as e:
self._finalize(False)
raise self.gcode.error(str(e))
self.gcode.reset_last_position()
def _move_next(self):
# Lift toolhead
self._lift_z(self.horizontal_move_z, self.lift_speed)
@ -340,7 +342,6 @@ class ProbePointsHelper:
self._move_next()
def _finalize(self, success):
self.busy = False
self.gcode.reset_last_position()
if success:
self.finalize_callback(self.probe_offsets, self.results)