[2.0.x] Add Z_AFTER_PROBING option (#10058)

Some "fix-mounted" probes need manual stowing. And after probing some may prefer to raise or lower the nozzle. This restores an old option but tailors it to allow raise or lower as preferred.
This commit is contained in:
Scott Lahteine
2018-03-11 13:07:55 -05:00
committed by GitHub
parent dd19e74476
commit 28f1276286
70 changed files with 119 additions and 10 deletions

View File

@ -51,7 +51,8 @@ void GcodeSuite::G30() {
setup_for_endstop_or_probe_move();
const float measured_z = probe_pt(xpos, ypos, parser.boolval('E'), 1);
const bool do_stow = parser.boolval('E');
const float measured_z = probe_pt(xpos, ypos, do_stow, 1);
if (!isnan(measured_z)) {
SERIAL_PROTOCOLPAIR("Bed X: ", FIXFLOAT(xpos));
@ -61,6 +62,8 @@ void GcodeSuite::G30() {
clean_up_after_endstop_or_probe_move();
if (do_stow) move_z_after_probing();
report_current_position();
}

View File

@ -25,16 +25,24 @@
#if HAS_BED_PROBE
#include "../gcode.h"
#include "../../module/motion.h"
#include "../../module/probe.h"
/**
* M401: Deploy and activate the Z probe
*/
void GcodeSuite::M401() { DEPLOY_PROBE(); }
void GcodeSuite::M401() {
DEPLOY_PROBE();
report_current_position();
}
/**
* M402: Deactivate and stow the Z probe
*/
void GcodeSuite::M402() { STOW_PROBE(); }
void GcodeSuite::M402() {
STOW_PROBE();
move_z_after_probing();
report_current_position();
}
#endif // HAS_BED_PROBE