Add Z_PROBE_END_SCRIPT to UBL (#14419)

This commit is contained in:
InsanityAutomation 2019-06-27 14:00:55 -04:00 committed by Scott Lahteine
parent 2580104c8b
commit b961251899

View File

@ -306,6 +306,7 @@
void unified_bed_leveling::G29() { void unified_bed_leveling::G29() {
bool probe_deployed = false;
if (g29_parameter_parsing()) return; // Abort on parameter error if (g29_parameter_parsing()) return; // Abort on parameter error
const int8_t p_val = parser.intval('P', -1); const int8_t p_val = parser.intval('P', -1);
@ -418,6 +419,7 @@
} }
do_blocking_move_to_xy(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y))); do_blocking_move_to_xy(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)));
report_current_position(); report_current_position();
probe_deployed = true;
} }
#endif // HAS_BED_PROBE #endif // HAS_BED_PROBE
@ -457,6 +459,7 @@
parser.seen('T'), parser.seen('E'), parser.seen('U')); parser.seen('T'), parser.seen('E'), parser.seen('U'));
report_current_position(); report_current_position();
probe_deployed = true;
break; break;
#endif // HAS_BED_PROBE #endif // HAS_BED_PROBE
@ -492,6 +495,7 @@
SERIAL_ECHOLNPGM("?Error in Business Card measurement."); SERIAL_ECHOLNPGM("?Error in Business Card measurement.");
return; return;
} }
probe_deployed = true;
} }
if (!position_is_reachable(g29_x_pos, g29_y_pos)) { if (!position_is_reachable(g29_x_pos, g29_y_pos)) {
@ -671,6 +675,14 @@
ui.release(); ui.release();
#endif #endif
#ifdef Z_PROBE_END_SCRIPT
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT);
if (probe_deployed) {
planner.synchronize();
process_subcommands_now_P(PSTR(Z_PROBE_END_SCRIPT));
}
#endif
return; return;
} }