|
@ -201,10 +201,6 @@ G29_TYPE GcodeSuite::G29() { |
|
|
ABL_VAR int abl_probe_index; |
|
|
ABL_VAR int abl_probe_index; |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#if BOTH(HAS_SOFTWARE_ENDSTOPS, PROBE_MANUALLY) |
|
|
|
|
|
ABL_VAR bool saved_soft_endstops_state = true; |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if ABL_GRID |
|
|
#if ABL_GRID |
|
|
|
|
|
|
|
|
#if ENABLED(PROBE_MANUALLY) |
|
|
#if ENABLED(PROBE_MANUALLY) |
|
@ -461,7 +457,7 @@ G29_TYPE GcodeSuite::G29() { |
|
|
// Abort current G29 procedure, go back to idle state
|
|
|
// Abort current G29 procedure, go back to idle state
|
|
|
if (seenA && g29_in_progress) { |
|
|
if (seenA && g29_in_progress) { |
|
|
SERIAL_ECHOLNPGM("Manual G29 aborted"); |
|
|
SERIAL_ECHOLNPGM("Manual G29 aborted"); |
|
|
TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = saved_soft_endstops_state); |
|
|
SET_SOFT_ENDSTOP_LOOSE(false); |
|
|
set_bed_leveling_enabled(abl_should_enable); |
|
|
set_bed_leveling_enabled(abl_should_enable); |
|
|
g29_in_progress = false; |
|
|
g29_in_progress = false; |
|
|
TERN_(LCD_BED_LEVELING, ui.wait_for_move = false); |
|
|
TERN_(LCD_BED_LEVELING, ui.wait_for_move = false); |
|
@ -482,7 +478,7 @@ G29_TYPE GcodeSuite::G29() { |
|
|
|
|
|
|
|
|
if (abl_probe_index == 0) { |
|
|
if (abl_probe_index == 0) { |
|
|
// For the initial G29 S2 save software endstop state
|
|
|
// For the initial G29 S2 save software endstop state
|
|
|
TERN_(HAS_SOFTWARE_ENDSTOPS, saved_soft_endstops_state = soft_endstops_enabled); |
|
|
SET_SOFT_ENDSTOP_LOOSE(true); |
|
|
// Move close to the bed before the first point
|
|
|
// Move close to the bed before the first point
|
|
|
do_blocking_move_to_z(0); |
|
|
do_blocking_move_to_z(0); |
|
|
} |
|
|
} |
|
@ -552,14 +548,14 @@ G29_TYPE GcodeSuite::G29() { |
|
|
_manual_goto_xy(probePos); // Can be used here too!
|
|
|
_manual_goto_xy(probePos); // Can be used here too!
|
|
|
// Disable software endstops to allow manual adjustment
|
|
|
// Disable software endstops to allow manual adjustment
|
|
|
// If G29 is not completed, they will not be re-enabled
|
|
|
// If G29 is not completed, they will not be re-enabled
|
|
|
TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = false); |
|
|
SET_SOFT_ENDSTOP_LOOSE(true); |
|
|
G29_RETURN(false); |
|
|
G29_RETURN(false); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
// Leveling done! Fall through to G29 finishing code below
|
|
|
// Leveling done! Fall through to G29 finishing code below
|
|
|
SERIAL_ECHOLNPGM("Grid probing done."); |
|
|
SERIAL_ECHOLNPGM("Grid probing done."); |
|
|
// Re-enable software endstops, if needed
|
|
|
// Re-enable software endstops, if needed
|
|
|
TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = saved_soft_endstops_state); |
|
|
SET_SOFT_ENDSTOP_LOOSE(false); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#elif ENABLED(AUTO_BED_LEVELING_3POINT) |
|
|
#elif ENABLED(AUTO_BED_LEVELING_3POINT) |
|
@ -570,7 +566,7 @@ G29_TYPE GcodeSuite::G29() { |
|
|
_manual_goto_xy(probePos); |
|
|
_manual_goto_xy(probePos); |
|
|
// Disable software endstops to allow manual adjustment
|
|
|
// Disable software endstops to allow manual adjustment
|
|
|
// If G29 is not completed, they will not be re-enabled
|
|
|
// If G29 is not completed, they will not be re-enabled
|
|
|
TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = false); |
|
|
SET_SOFT_ENDSTOP_LOOSE(true); |
|
|
G29_RETURN(false); |
|
|
G29_RETURN(false); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
@ -578,7 +574,7 @@ G29_TYPE GcodeSuite::G29() { |
|
|
SERIAL_ECHOLNPGM("3-point probing done."); |
|
|
SERIAL_ECHOLNPGM("3-point probing done."); |
|
|
|
|
|
|
|
|
// Re-enable software endstops, if needed
|
|
|
// Re-enable software endstops, if needed
|
|
|
TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = saved_soft_endstops_state); |
|
|
SET_SOFT_ENDSTOP_LOOSE(false); |
|
|
|
|
|
|
|
|
if (!dryrun) { |
|
|
if (!dryrun) { |
|
|
vector_3 planeNormal = vector_3::cross(points[0] - points[1], points[2] - points[1]).get_normal(); |
|
|
vector_3 planeNormal = vector_3::cross(points[0] - points[1], points[2] - points[1]).get_normal(); |
|
|