Move set_all_z_lock to Stepper

This commit is contained in:
Scott Lahteine
2020-05-31 01:03:28 -05:00
parent c9a260ee12
commit a1f3d2f3cd
3 changed files with 17 additions and 28 deletions

View File

@ -47,17 +47,6 @@
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../../core/debug_out.h"
inline void set_all_z_lock(const bool lock) {
stepper.set_z_lock(lock);
stepper.set_z2_lock(lock);
#if NUM_Z_STEPPER_DRIVERS >= 3
stepper.set_z3_lock(lock);
#if NUM_Z_STEPPER_DRIVERS >= 4
stepper.set_z4_lock(lock);
#endif
#endif
}
/**
* G34: Z-Stepper automatic alignment
*
@ -318,17 +307,7 @@ void GcodeSuite::G34() {
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " corrected by ", z_align_move);
// Lock all steppers except one
set_all_z_lock(true);
switch (zstepper) {
case 0: stepper.set_z_lock(false); break;
case 1: stepper.set_z2_lock(false); break;
#if NUM_Z_STEPPER_DRIVERS >= 3
case 2: stepper.set_z3_lock(false); break;
#endif
#if NUM_Z_STEPPER_DRIVERS == 4
case 3: stepper.set_z4_lock(false); break;
#endif
}
stepper.set_all_z_lock(true, zstepper);
#if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
// Decreasing accuracy was detected so move was inverted.
@ -342,7 +321,7 @@ void GcodeSuite::G34() {
} // for (zstepper)
// Back to normal stepper operations
set_all_z_lock(false);
stepper.set_all_z_lock(false);
stepper.set_separate_multi_axis(false);
if (err_break) break;