Fix and improve software endstops (#13386)

This commit is contained in:
Scott Lahteine
2019-03-13 05:48:36 -05:00
committed by GitHub
parent 6214c997c0
commit 87162658c4
13 changed files with 131 additions and 123 deletions

View File

@ -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) {