💥 Num Axes and Multi-Stepper based on Driver Types (#24120)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
Keith Bennett
2022-05-04 17:25:02 -07:00
committed by GitHub
parent 6237a6a6d3
commit df40181357
33 changed files with 266 additions and 259 deletions

View File

@@ -2038,7 +2038,7 @@ void prepare_line_to_destination() {
#if ENABLED(Z_MULTI_ENDSTOPS)
if (axis == Z_AXIS) {
#if NUM_Z_STEPPER_DRIVERS == 2
#if NUM_Z_STEPPERS == 2
const float adj = ABS(endstops.z2_endstop_adj);
if (adj) {
@@ -2056,13 +2056,13 @@ void prepare_line_to_destination() {
adjustFunc_t lock[] = {
stepper.set_z1_lock, stepper.set_z2_lock, stepper.set_z3_lock
#if NUM_Z_STEPPER_DRIVERS >= 4
#if NUM_Z_STEPPERS >= 4
, stepper.set_z4_lock
#endif
};
float adj[] = {
0, endstops.z2_endstop_adj, endstops.z3_endstop_adj
#if NUM_Z_STEPPER_DRIVERS >= 4
#if NUM_Z_STEPPERS >= 4
, endstops.z4_endstop_adj
#endif
};
@@ -2081,7 +2081,7 @@ void prepare_line_to_destination() {
lock[1] = lock[2], adj[1] = adj[2];
lock[2] = tempLock, adj[2] = tempAdj;
}
#if NUM_Z_STEPPER_DRIVERS >= 4
#if NUM_Z_STEPPERS >= 4
if (adj[3] < adj[2]) {
tempLock = lock[2], tempAdj = adj[2];
lock[2] = lock[3], adj[2] = adj[3];
@@ -2106,14 +2106,14 @@ void prepare_line_to_destination() {
// lock the second stepper for the final correction
(*lock[1])(true);
do_homing_move(axis, adj[2] - adj[1]);
#if NUM_Z_STEPPER_DRIVERS >= 4
#if NUM_Z_STEPPERS >= 4
// lock the third stepper for the final correction
(*lock[2])(true);
do_homing_move(axis, adj[3] - adj[2]);
#endif
}
else {
#if NUM_Z_STEPPER_DRIVERS >= 4
#if NUM_Z_STEPPERS >= 4
(*lock[3])(true);
do_homing_move(axis, adj[2] - adj[3]);
#endif
@@ -2126,7 +2126,7 @@ void prepare_line_to_destination() {
stepper.set_z1_lock(false);
stepper.set_z2_lock(false);
stepper.set_z3_lock(false);
#if NUM_Z_STEPPER_DRIVERS >= 4
#if NUM_Z_STEPPERS >= 4
stepper.set_z4_lock(false);
#endif