From 80ada588181f6062ada9741aa8bdc28a581c50d8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 24 Nov 2017 17:10:27 -0600 Subject: [PATCH] One fewer function call in probe_pt --- Marlin/src/module/probe.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 127c6b0035..a6591db583 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -594,17 +594,20 @@ float probe_pt(const float &rx, const float &ry, const bool stow, const uint8_t : !position_is_reachable_by_probe(rx, ry) ) return NAN; - const float old_feedrate_mm_s = feedrate_mm_s; - - #if ENABLED(DELTA) - if (current_position[Z_AXIS] > delta_clip_start_height) - do_blocking_move_to_z(delta_clip_start_height); - #endif + const float nz = + #if ENABLED(DELTA) + // Move below clip height or xy move will be aborted by do_blocking_move_to + min(current_position[Z_AXIS], delta_clip_start_height) + #else + current_position[Z_AXIS] + #endif + ; + const float old_feedrate_mm_s = feedrate_mm_s; feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S; - // Move the probe to the given XY - do_blocking_move_to_xy(nx, ny); + // Move the probe to the starting XYZ + do_blocking_move_to(nx, ny, nz); float measured_z = NAN; if (!DEPLOY_PROBE()) {