[2.0.x] Add O (optional) flag to G28/G29 (#10913)

This commit is contained in:
Robert Mendon
2018-06-11 20:51:48 -06:00
committed by Scott Lahteine
parent 2ddba201c0
commit 86170e6a66
2 changed files with 23 additions and 0 deletions

View File

@ -68,6 +68,8 @@
*
* Enhanced G29 Auto Bed Leveling Probe Routine
*
* O Auto-level only if needed
*
* D Dry-Run mode. Just evaluate the bed Topology - Don't apply
* or alter the bed level data. Useful to check the topology
* after a first run of G29.
@ -174,6 +176,15 @@ void GcodeSuite::G29() {
// Don't allow auto-leveling without homing first
if (axis_unhomed_error()) return;
if (!no_action && planner.leveling_active && parser.boolval('O')) { // Auto-level only if needed
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
SERIAL_ECHOLNPGM("> Auto-level not needed, skip");
SERIAL_ECHOLNPGM("<<< G29");
}
#endif
return;
}
// Define local vars 'static' for manual probing, 'auto' otherwise
#if ENABLED(PROBE_MANUALLY)
#define ABL_VAR static