🔧 Base NUM_AXES on defined DRIVER_TYPEs (#24106)

This commit is contained in:
Scott Lahteine
2022-04-29 15:21:15 -05:00
parent 12eb1e0829
commit b37d13af72
7 changed files with 320 additions and 268 deletions

View File

@@ -1754,7 +1754,7 @@ void prepare_line_to_destination() {
phasePerUStep = PHASE_PER_MICROSTEP(X);
phaseCurrent = stepperX.get_microstep_counter();
effectorBackoutDir = -X_HOME_DIR;
stepperBackoutDir = INVERT_X_DIR ? effectorBackoutDir : -effectorBackoutDir;
stepperBackoutDir = IF_DISABLED(INVERT_X_DIR, -)effectorBackoutDir;
break;
#endif
#ifdef Y_MICROSTEPS
@@ -1762,7 +1762,7 @@ void prepare_line_to_destination() {
phasePerUStep = PHASE_PER_MICROSTEP(Y);
phaseCurrent = stepperY.get_microstep_counter();
effectorBackoutDir = -Y_HOME_DIR;
stepperBackoutDir = INVERT_Y_DIR ? effectorBackoutDir : -effectorBackoutDir;
stepperBackoutDir = IF_DISABLED(INVERT_Y_DIR, -)effectorBackoutDir;
break;
#endif
#ifdef Z_MICROSTEPS
@@ -1770,7 +1770,7 @@ void prepare_line_to_destination() {
phasePerUStep = PHASE_PER_MICROSTEP(Z);
phaseCurrent = stepperZ.get_microstep_counter();
effectorBackoutDir = -Z_HOME_DIR;
stepperBackoutDir = INVERT_Z_DIR ? effectorBackoutDir : -effectorBackoutDir;
stepperBackoutDir = IF_DISABLED(INVERT_Z_DIR, -)effectorBackoutDir;
break;
#endif
#ifdef I_MICROSTEPS
@@ -1778,7 +1778,7 @@ void prepare_line_to_destination() {
phasePerUStep = PHASE_PER_MICROSTEP(I);
phaseCurrent = stepperI.get_microstep_counter();
effectorBackoutDir = -I_HOME_DIR;
stepperBackoutDir = INVERT_I_DIR ? effectorBackoutDir : -effectorBackoutDir;
stepperBackoutDir = IF_DISABLED(INVERT_I_DIR, -)effectorBackoutDir;
break;
#endif
#ifdef J_MICROSTEPS
@@ -1786,7 +1786,7 @@ void prepare_line_to_destination() {
phasePerUStep = PHASE_PER_MICROSTEP(J);
phaseCurrent = stepperJ.get_microstep_counter();
effectorBackoutDir = -J_HOME_DIR;
stepperBackoutDir = INVERT_J_DIR ? effectorBackoutDir : -effectorBackoutDir;
stepperBackoutDir = IF_DISABLED(INVERT_J_DIR, -)effectorBackoutDir;
break;
#endif
#ifdef K_MICROSTEPS
@@ -1794,7 +1794,7 @@ void prepare_line_to_destination() {
phasePerUStep = PHASE_PER_MICROSTEP(K);
phaseCurrent = stepperK.get_microstep_counter();
effectorBackoutDir = -K_HOME_DIR;
stepperBackoutDir = INVERT_K_DIR ? effectorBackoutDir : -effectorBackoutDir;
stepperBackoutDir = IF_DISABLED(INVERT_K_DIR, -)effectorBackoutDir;
break;
#endif
#ifdef U_MICROSTEPS
@@ -1802,7 +1802,7 @@ void prepare_line_to_destination() {
phasePerUStep = PHASE_PER_MICROSTEP(U);
phaseCurrent = stepperU.get_microstep_counter();
effectorBackoutDir = -U_HOME_DIR;
stepperBackoutDir = INVERT_U_DIR ? effectorBackoutDir : -effectorBackoutDir;
stepperBackoutDir = IF_DISABLED(INVERT_U_DIR, -)effectorBackoutDir;
break;
#endif
#ifdef V_MICROSTEPS
@@ -1810,7 +1810,7 @@ void prepare_line_to_destination() {
phasePerUStep = PHASE_PER_MICROSTEP(V);
phaseCurrent = stepperV.get_microstep_counter();
effectorBackoutDir = -V_HOME_DIR;
stepperBackoutDir = INVERT_V_DIR ? effectorBackoutDir : -effectorBackoutDir;
stepperBackoutDir = IF_DISABLED(INVERT_V_DIR, -)effectorBackoutDir;
break;
#endif
#ifdef W_MICROSTEPS
@@ -1818,7 +1818,7 @@ void prepare_line_to_destination() {
phasePerUStep = PHASE_PER_MICROSTEP(W);
phaseCurrent = stepperW.get_microstep_counter();
effectorBackoutDir = -W_HOME_DIR;
stepperBackoutDir = INVERT_W_DIR ? effectorBackoutDir : -effectorBackoutDir;
stepperBackoutDir = IF_DISABLED(INVERT_W_DIR, -)effectorBackoutDir;
break;
#endif
default: return;