Skip to content

Commit

Permalink
ZOffsetProbe: implement SAMPLES_DROP
Browse files Browse the repository at this point in the history
  • Loading branch information
miklschmidt committed Sep 28, 2024
1 parent e4f6329 commit c34d023
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions klippy/z_offset_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ def run_probe(self, gcmd):
samples_retries = gcmd.get_int("SAMPLES_TOLERANCE_RETRIES",
self.samples_retries, minval=0)
samples_result = gcmd.get("SAMPLES_RESULT", self.samples_result)
samples_drop = gcmd.get_int("SAMPLES_DROP", 0, minval=0)
must_notify_multi_probe = not self.multi_probe_pending
if must_notify_multi_probe:
self.multi_probe_begin()
Expand All @@ -167,6 +168,9 @@ def run_probe(self, gcmd):
while len(positions) < sample_count:
# Probe position
pos = self._probe(speed)
if samples_drop > 0:
samples_drop -= 1
continue
positions.append(pos)
# Check samples tolerance
z_positions = [p[2] for p in positions]
Expand Down

0 comments on commit c34d023

Please sign in to comment.