Allow no raise after run_z_probe in probe_pt

This commit is contained in:
Scott Lahteine
2018-03-21 01:01:43 -05:00
parent ae39fbd646
commit c352954882
7 changed files with 28 additions and 21 deletions

View File

@ -631,13 +631,15 @@ static float run_z_probe() {
* - Raise to the BETWEEN height
* - Return the probed Z position
*/
float probe_pt(const float &rx, const float &ry, const bool stow, const uint8_t verbose_level, const bool probe_relative/*=true*/) {
float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/) {
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPAIR(">>> probe_pt(", LOGICAL_X_POSITION(rx));
SERIAL_ECHOPAIR(", ", LOGICAL_Y_POSITION(ry));
SERIAL_ECHOPAIR(", ", stow ? "" : "no ");
SERIAL_ECHOLNPGM("stow)");
SERIAL_ECHOPAIR(", ", raise_after == PROBE_PT_RAISE ? "raise" : raise_after == PROBE_PT_STOW ? "stow" : "none");
SERIAL_ECHOPAIR(", ", int(verbose_level));
SERIAL_ECHOPAIR(", ", probe_relative ? "probe" : "nozzle");
SERIAL_ECHOLNPGM("_relative)");
DEBUG_POS("", current_position);
}
#endif
@ -670,9 +672,9 @@ float probe_pt(const float &rx, const float &ry, const bool stow, const uint8_t
if (!DEPLOY_PROBE()) {
measured_z = run_z_probe() + zprobe_zoffset;
if (!stow)
if (raise_after == PROBE_PT_RAISE)
do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
else
else if (raise_after == PROBE_PT_STOW)
if (STOW_PROBE()) measured_z = NAN;
}