Skip to content

Commit

Permalink
Add probe_at_point() lift_relative argument
Browse files Browse the repository at this point in the history
  • Loading branch information
James Pearson committed Apr 28, 2023
1 parent 108b144 commit a1cf215
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/module/probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/, const float z_min_poi
*/
float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/,
const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/, const bool sanity_check/*=true*/,
const float z_min_point/*=Z_PROBE_LOW_POINT*/, const float z_clearance/*=Z_TWEEN_SAFE_CLEARANCE*/
const float z_min_point/*=Z_PROBE_LOW_POINT*/, const float z_clearance/*=Z_TWEEN_SAFE_CLEARANCE*/, const bool lift_relative/*=false*/
) {
DEBUG_SECTION(log_probe, "Probe::probe_at_point", DEBUGGING(LEVELING));

Expand Down Expand Up @@ -961,7 +961,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
switch (raise_after) {
default: break;
case PROBE_PT_RAISE:
do_z_clearance(z_clearance);
lift_relative ? do_z_clearance(current_position.z + z_clearance, false) : do_z_clearance(z_clearance);
break;
case PROBE_PT_STOW: case PROBE_PT_LAST_STOW:
if (stow()) measured_z = NAN; // Error on stow?
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/module/probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ class Probe {

static float probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRaise raise_after=PROBE_PT_NONE,
const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true,
const float z_min_point=Z_PROBE_LOW_POINT, const float z_clearance=Z_TWEEN_SAFE_CLEARANCE);
const float z_min_point=Z_PROBE_LOW_POINT, const float z_clearance=Z_TWEEN_SAFE_CLEARANCE, const bool lift_relative=false);

static float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE,
const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true,
const float z_min_point=Z_PROBE_LOW_POINT, const float z_clearance=Z_TWEEN_SAFE_CLEARANCE
const float z_min_point=Z_PROBE_LOW_POINT, float z_clearance=Z_TWEEN_SAFE_CLEARANCE, const bool lift_relative=false
) {
return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative, sanity_check, z_min_point, z_clearance);
return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative, sanity_check, z_min_point, z_clearance, lift_relative);
}

#else // !HAS_BED_PROBE
Expand Down

0 comments on commit a1cf215

Please sign in to comment.