From c6a7adc29359b135e77e0f0f2c171ab1dd3c99b3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 29 May 2017 16:00:57 -0500 Subject: [PATCH] Patch G29 A and Q arguments to bypass setup --- Marlin/Marlin_main.cpp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6003b7881..158b552d3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4134,8 +4134,14 @@ void home_all_axes() { gcode_G28(true); } #endif #endif + #if ENABLED(PROBE_MANUALLY) + const bool seenA = parser.seen('A'), seenQ = parser.seen('Q'), no_action = seenA || seenQ; + #endif + #if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) const bool faux = parser.seen('C') && parser.value_bool(); + #elif ENABLED(PROBE_MANUALLY) + const bool faux = no_action; #else bool constexpr faux = false; #endif @@ -4281,7 +4287,11 @@ void home_all_axes() { gcode_G28(true); } return; } - dryrun = parser.seen('D') && parser.value_bool(); + dryrun = (parser.seen('D') && parser.value_bool()) + #if ENABLED(PROBE_MANUALLY) + || no_action + #endif + ; #if ENABLED(AUTO_BED_LEVELING_LINEAR) @@ -4426,16 +4436,14 @@ void home_all_axes() { gcode_G28(true); } #if ENABLED(PROBE_MANUALLY) - const bool seenA = parser.seen('A'), seenQ = parser.seen('Q'); - // For manual probing, get the next index to probe now. // On the first probe this will be incremented to 0. - if (!seenA && !seenQ) { + if (!no_action) { ++abl_probe_index; g29_in_progress = true; } - // Abort current G29 procedure, go back to ABLStart + // Abort current G29 procedure, go back to idle state if (seenA && g29_in_progress) { SERIAL_PROTOCOLLNPGM("Manual G29 aborted"); #if HAS_SOFTWARE_ENDSTOPS @@ -4459,7 +4467,7 @@ void home_all_axes() { gcode_G28(true); } SERIAL_PROTOCOLLNPGM("idle"); } - if (seenA || seenQ) return; + if (no_action) return; if (abl_probe_index == 0) { // For the initial G29 save software endstop state @@ -4484,6 +4492,14 @@ void home_all_axes() { gcode_G28(true); } z_values[xCount][yCount] = measured_z + zoffset; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_PROTOCOLPAIR("Save X", xCount); + SERIAL_PROTOCOLPAIR(" Y", yCount); + SERIAL_PROTOCOLLNPAIR(" Z", measured_z + zoffset); + } + #endif + #elif ENABLED(AUTO_BED_LEVELING_3POINT) points[i].z = measured_z;