Fix and improve software endstops (#13386)
This commit is contained in:
@ -212,7 +212,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
#endif
|
||||
|
||||
#if HAS_SOFTWARE_ENDSTOPS && ENABLED(PROBE_MANUALLY)
|
||||
ABL_VAR bool enable_soft_endstops = true;
|
||||
ABL_VAR bool saved_soft_endstops_state = true;
|
||||
#endif
|
||||
|
||||
#if ABL_GRID
|
||||
@ -494,7 +494,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
if (seenA && g29_in_progress) {
|
||||
SERIAL_ECHOLNPGM("Manual G29 aborted");
|
||||
#if HAS_SOFTWARE_ENDSTOPS
|
||||
soft_endstops_enabled = enable_soft_endstops;
|
||||
soft_endstops_enabled = saved_soft_endstops_state;
|
||||
#endif
|
||||
set_bed_leveling_enabled(abl_should_enable);
|
||||
g29_in_progress = false;
|
||||
@ -519,7 +519,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
if (abl_probe_index == 0) {
|
||||
// For the initial G29 S2 save software endstop state
|
||||
#if HAS_SOFTWARE_ENDSTOPS
|
||||
enable_soft_endstops = soft_endstops_enabled;
|
||||
saved_soft_endstops_state = soft_endstops_enabled;
|
||||
#endif
|
||||
// Move close to the bed before the first point
|
||||
do_blocking_move_to_z(0);
|
||||
@ -617,7 +617,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
|
||||
// Re-enable software endstops, if needed
|
||||
#if HAS_SOFTWARE_ENDSTOPS
|
||||
soft_endstops_enabled = enable_soft_endstops;
|
||||
soft_endstops_enabled = saved_soft_endstops_state;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -641,7 +641,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
|
||||
// Re-enable software endstops, if needed
|
||||
#if HAS_SOFTWARE_ENDSTOPS
|
||||
soft_endstops_enabled = enable_soft_endstops;
|
||||
soft_endstops_enabled = saved_soft_endstops_state;
|
||||
#endif
|
||||
|
||||
if (!dryrun) {
|
||||
|
@ -59,7 +59,7 @@ void GcodeSuite::G29() {
|
||||
|
||||
static int mbl_probe_index = -1;
|
||||
#if HAS_SOFTWARE_ENDSTOPS
|
||||
static bool enable_soft_endstops;
|
||||
static bool saved_soft_endstops_state;
|
||||
#endif
|
||||
|
||||
MeshLevelingState state = (MeshLevelingState)parser.byteval('S', (int8_t)MeshReport);
|
||||
@ -99,7 +99,7 @@ void GcodeSuite::G29() {
|
||||
if (mbl_probe_index == 0) {
|
||||
#if HAS_SOFTWARE_ENDSTOPS
|
||||
// For the initial G29 S2 save software endstop state
|
||||
enable_soft_endstops = soft_endstops_enabled;
|
||||
saved_soft_endstops_state = soft_endstops_enabled;
|
||||
#endif
|
||||
// Move close to the bed before the first point
|
||||
do_blocking_move_to_z(0);
|
||||
@ -108,7 +108,7 @@ void GcodeSuite::G29() {
|
||||
// Save Z for the previous mesh position
|
||||
mbl.set_zigzag_z(mbl_probe_index - 1, current_position[Z_AXIS]);
|
||||
#if HAS_SOFTWARE_ENDSTOPS
|
||||
soft_endstops_enabled = enable_soft_endstops;
|
||||
soft_endstops_enabled = saved_soft_endstops_state;
|
||||
#endif
|
||||
}
|
||||
// If there's another point to sample, move there with optional lift.
|
||||
|
Reference in New Issue
Block a user