Internal G29N for G28+G29 (#20800)
This commit is contained in:
@ -181,14 +181,18 @@ G29_TYPE GcodeSuite::G29() {
|
||||
no_action = seenA || seenQ,
|
||||
faux = ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) ? parser.boolval('C') : no_action;
|
||||
|
||||
// Don't allow auto-leveling without homing first
|
||||
if (homing_needed_error()) G29_RETURN(false);
|
||||
|
||||
if (!no_action && planner.leveling_active && parser.boolval('O')) { // Auto-level only if needed
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> Auto-level not needed, skip");
|
||||
G29_RETURN(false);
|
||||
}
|
||||
|
||||
// Send 'N' to force homing before G29 (internal only)
|
||||
if (parser.seen('N'))
|
||||
gcode.process_subcommands_now_P(TERN(G28_L0_ENSURES_LEVELING_OFF, PSTR("G28L0"), G28_STR));
|
||||
|
||||
// Don't allow auto-leveling without homing first
|
||||
if (homing_needed_error()) G29_RETURN(false);
|
||||
|
||||
// Define local vars 'static' for manual probing, 'auto' otherwise
|
||||
#define ABL_VAR TERN_(PROBE_MANUALLY, static)
|
||||
|
||||
@ -249,7 +253,6 @@ G29_TYPE GcodeSuite::G29() {
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
|
||||
struct linear_fit_data lsf_results;
|
||||
incremental_LSF_reset(&lsf_results);
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -324,6 +327,8 @@ G29_TYPE GcodeSuite::G29() {
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
|
||||
|
||||
incremental_LSF_reset(&lsf_results);
|
||||
|
||||
do_topography_map = verbose_level > 2 || parser.boolval('T');
|
||||
|
||||
// X and Y specify points in each direction, overriding the default
|
||||
|
@ -85,7 +85,7 @@ void GcodeSuite::G29() {
|
||||
mbl.reset();
|
||||
mbl_probe_index = 0;
|
||||
if (!ui.wait_for_move) {
|
||||
queue.inject_P(PSTR("G28\nG29 S2"));
|
||||
queue.inject_P(parser.seen('N') ? PSTR("G28" TERN(G28_L0_ENSURES_LEVELING_OFF, "L0", "") "\nG29S2") : PSTR("G29S2"));
|
||||
return;
|
||||
}
|
||||
state = MeshNext;
|
||||
|
Reference in New Issue
Block a user