🧑‍💻 Apply axis conditionals

This commit is contained in:
Scott Lahteine 2022-01-02 09:22:36 -06:00 committed by Scott Lahteine
parent a732427329
commit 9956e62674
28 changed files with 215 additions and 225 deletions

View File

@ -368,7 +368,7 @@
#define LCD_STR_E STR_E
// Extra Axis and Endstop Names
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#if AXIS4_NAME == 'A'
#define AXIS4_STR "A"
#define STR_I_MIN "a_min"
@ -402,7 +402,7 @@
#define AXIS4_STR ""
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#if AXIS5_NAME == 'A'
#define AXIS5_STR "A"
#define STR_J_MIN "a_min"
@ -436,7 +436,7 @@
#define AXIS5_STR ""
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#if AXIS6_NAME == 'A'
#define AXIS6_STR "A"
#define STR_K_MIN "a_min"

View File

@ -98,10 +98,10 @@ enum AxisEnum : uint8_t {
// A, B, and C are for DELTA, SCARA, etc.
, A_AXIS = X_AXIS
#if LINEAR_AXES >= 2
#if HAS_Y_AXIS
, B_AXIS = Y_AXIS
#endif
#if LINEAR_AXES >= 3
#if HAS_Z_AXIS
, C_AXIS = Z_AXIS
#endif
@ -408,13 +408,13 @@ struct XYZval {
FI void set(const T (&arr)[DISTINCT_AXES]) { LINEAR_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5]); }
#endif
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; }
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
FI void set(const T px, const T py, const T pz, const T pi) { x = px; y = py; z = pz; i = pi; }
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
FI void set(const T px, const T py, const T pz, const T pi, const T pj) { x = px; y = py; z = pz; i = pi; j = pj; }
#endif
@ -549,13 +549,13 @@ struct XYZEval {
FI void set(const XYZval<T> pxyz, const T pe) { set(pxyz); e = pe; }
FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, u = i, v = j, w = k); }
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; }
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
FI void set(const T px, const T py, const T pz, const T pi) { x = px; y = py; z = pz; i = pi; }
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
FI void set(const T px, const T py, const T pz, const T pi, const T pj) { x = px; y = py; z = pz; i = pi; j = pj; }
#endif

View File

@ -441,15 +441,9 @@ void GcodeSuite::G28() {
}
#endif
#if LINEAR_AXES >= 4
if (doI) homeaxis(I_AXIS);
#endif
#if LINEAR_AXES >= 5
if (doJ) homeaxis(J_AXIS);
#endif
#if LINEAR_AXES >= 6
if (doK) homeaxis(K_AXIS);
#endif
TERN_(HAS_I_AXIS, if (doI) homeaxis(I_AXIS));
TERN_(HAS_J_AXIS, if (doJ) homeaxis(J_AXIS));
TERN_(HAS_K_AXIS, if (doK) homeaxis(K_AXIS));
sync_plan_position();

View File

@ -73,16 +73,16 @@
#if BOTH(CALIBRATION_MEASURE_LEFT, CALIBRATION_MEASURE_RIGHT)
#define HAS_X_CENTER 1
#endif
#if HAS_Y_AXIS && BOTH(CALIBRATION_MEASURE_FRONT, CALIBRATION_MEASURE_BACK)
#if ALL(HAS_Y_AXIS, CALIBRATION_MEASURE_FRONT, CALIBRATION_MEASURE_BACK)
#define HAS_Y_CENTER 1
#endif
#if LINEAR_AXES >= 4 && BOTH(CALIBRATION_MEASURE_IMIN, CALIBRATION_MEASURE_IMAX)
#if ALL(HAS_I_AXIS, CALIBRATION_MEASURE_IMIN, CALIBRATION_MEASURE_IMAX)
#define HAS_I_CENTER 1
#endif
#if LINEAR_AXES >= 5 && BOTH(CALIBRATION_MEASURE_JMIN, CALIBRATION_MEASURE_JMAX)
#if ALL(HAS_J_AXIS, CALIBRATION_MEASURE_JMIN, CALIBRATION_MEASURE_JMAX)
#define HAS_J_CENTER 1
#endif
#if LINEAR_AXES >= 6 && BOTH(CALIBRATION_MEASURE_KMIN, CALIBRATION_MEASURE_KMAX)
#if ALL(HAS_K_AXIS, CALIBRATION_MEASURE_KMIN, CALIBRATION_MEASURE_KMAX)
#define HAS_K_CENTER 1
#endif
@ -246,7 +246,7 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t
case RIGHT: dir = -1;
case LEFT: axis = X_AXIS; break;
#endif
#if LINEAR_AXES >= 2 && AXIS_CAN_CALIBRATE(Y)
#if HAS_Y_AXIS && AXIS_CAN_CALIBRATE(Y)
case BACK: dir = -1;
case FRONT: axis = Y_AXIS; break;
#endif
@ -258,15 +258,15 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t
return;
}
#endif
#if LINEAR_AXES >= 4 && AXIS_CAN_CALIBRATE(I)
#if HAS_I_AXIS && AXIS_CAN_CALIBRATE(I)
case IMINIMUM: dir = -1;
case IMAXIMUM: axis = I_AXIS; break;
#endif
#if LINEAR_AXES >= 5 && AXIS_CAN_CALIBRATE(J)
#if HAS_J_AXIS && AXIS_CAN_CALIBRATE(J)
case JMINIMUM: dir = -1;
case JMAXIMUM: axis = J_AXIS; break;
#endif
#if LINEAR_AXES >= 6 && AXIS_CAN_CALIBRATE(K)
#if HAS_K_AXIS && AXIS_CAN_CALIBRATE(K)
case KMINIMUM: dir = -1;
case KMAXIMUM: axis = K_AXIS; break;
#endif
@ -370,7 +370,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
SERIAL_ECHOLNPGM(" Back: ", m.obj_side[BACK]);
#endif
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#if ENABLED(CALIBRATION_MEASURE_IMIN)
SERIAL_ECHOLNPGM(" " STR_I_MIN ": ", m.obj_side[IMINIMUM]);
#endif
@ -378,7 +378,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
SERIAL_ECHOLNPGM(" " STR_I_MAX ": ", m.obj_side[IMAXIMUM]);
#endif
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#if ENABLED(CALIBRATION_MEASURE_JMIN)
SERIAL_ECHOLNPGM(" " STR_J_MIN ": ", m.obj_side[JMINIMUM]);
#endif
@ -386,7 +386,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
SERIAL_ECHOLNPGM(" " STR_J_MAX ": ", m.obj_side[JMAXIMUM]);
#endif
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#if ENABLED(CALIBRATION_MEASURE_KMIN)
SERIAL_ECHOLNPGM(" " STR_K_MIN ": ", m.obj_side[KMINIMUM]);
#endif
@ -439,7 +439,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
#if HAS_Z_AXIS && AXIS_CAN_CALIBRATE(Z)
SERIAL_ECHOLNPGM(" Top: ", m.backlash[TOP]);
#endif
#if LINEAR_AXES >= 4 && AXIS_CAN_CALIBRATE(I)
#if HAS_I_AXIS && AXIS_CAN_CALIBRATE(I)
#if ENABLED(CALIBRATION_MEASURE_IMIN)
SERIAL_ECHOLNPGM(" " STR_I_MIN ": ", m.backlash[IMINIMUM]);
#endif
@ -447,7 +447,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
SERIAL_ECHOLNPGM(" " STR_I_MAX ": ", m.backlash[IMAXIMUM]);
#endif
#endif
#if LINEAR_AXES >= 5 && AXIS_CAN_CALIBRATE(J)
#if HAS_J_AXIS && AXIS_CAN_CALIBRATE(J)
#if ENABLED(CALIBRATION_MEASURE_JMIN)
SERIAL_ECHOLNPGM(" " STR_J_MIN ": ", m.backlash[JMINIMUM]);
#endif
@ -455,7 +455,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
SERIAL_ECHOLNPGM(" " STR_J_MAX ": ", m.backlash[JMAXIMUM]);
#endif
#endif
#if LINEAR_AXES >= 6 && AXIS_CAN_CALIBRATE(K)
#if HAS_K_AXIS && AXIS_CAN_CALIBRATE(K)
#if ENABLED(CALIBRATION_MEASURE_KMIN)
SERIAL_ECHOLNPGM(" " STR_K_MIN ": ", m.backlash[KMINIMUM]);
#endif

View File

@ -38,19 +38,19 @@
#if M91x_USE(X) || M91x_USE(X2)
#define M91x_SOME_X 1
#endif
#if LINEAR_AXES >= 2 && (M91x_USE(Y) || M91x_USE(Y2))
#if HAS_Y_AXIS && (M91x_USE(Y) || M91x_USE(Y2))
#define M91x_SOME_Y 1
#endif
#if HAS_Z_AXIS && (M91x_USE(Z) || M91x_USE(Z2) || M91x_USE(Z3) || M91x_USE(Z4))
#define M91x_SOME_Z 1
#endif
#if LINEAR_AXES >= 4 && M91x_USE(I)
#if HAS_I_AXIS && M91x_USE(I)
#define M91x_USE_I 1
#endif
#if LINEAR_AXES >= 5 && M91x_USE(J)
#if HAS_J_AXIS && M91x_USE(J)
#define M91x_USE_J 1
#endif
#if LINEAR_AXES >= 6 && M91x_USE(K)
#if HAS_K_AXIS && M91x_USE(K)
#define M91x_USE_K 1
#endif

View File

@ -693,6 +693,15 @@
#define HAS_Y_AXIS 1
#if LINEAR_AXES >= XYZ
#define HAS_Z_AXIS 1
#if LINEAR_AXES >= 4
#define HAS_I_AXIS 1
#if LINEAR_AXES >= 5
#define HAS_J_AXIS 1
#if LINEAR_AXES >= 6
#define HAS_K_AXIS 1
#endif
#endif
#endif
#endif
#endif
@ -1215,13 +1224,13 @@
#if HAS_Z_AXIS && !defined(INVERT_Z_DIR)
#define INVERT_Z_DIR false
#endif
#if LINEAR_AXES >= 4 && !defined(INVERT_I_DIR)
#if HAS_I_AXIS && !defined(INVERT_I_DIR)
#define INVERT_I_DIR false
#endif
#if LINEAR_AXES >= 5 && !defined(INVERT_J_DIR)
#if HAS_J_AXIS && !defined(INVERT_J_DIR)
#define INVERT_J_DIR false
#endif
#if LINEAR_AXES >= 6 && !defined(INVERT_K_DIR)
#if HAS_K_AXIS && !defined(INVERT_K_DIR)
#define INVERT_K_DIR false
#endif
#if HAS_EXTRUDERS && !defined(INVERT_E_DIR)
@ -1411,7 +1420,7 @@
#endif
#endif
#if ANY(USE_XMIN_PLUG, USE_YMIN_PLUG, USE_ZMIN_PLUG, USE_XMAX_PLUG, USE_YMAX_PLUG, USE_ZMAX_PLUG)
#if X_HOME_DIR || (HAS_Y_AXIS && Y_HOME_DIR) || (HAS_Z_AXIS && Z_HOME_DIR) || (HAS_I_AXIS && I_HOME_DIR) || (HAS_J_AXIS && J_HOME_DIR) || (HAS_K_AXIS && K_HOME_DIR)
#define HAS_ENDSTOPS 1
#define COORDINATE_OKAY(N,L,H) WITHIN(N,L,H)
#else

View File

@ -97,13 +97,13 @@
#else
#undef CONTROLLER_FAN_USE_Z_ONLY
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#define I_MAX_LENGTH (I_MAX_POS - (I_MIN_POS))
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#define J_MAX_LENGTH (J_MAX_POS - (J_MIN_POS))
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#define K_MAX_LENGTH (K_MAX_POS - (K_MIN_POS))
#endif
@ -114,13 +114,13 @@
#if HAS_Y_AXIS && !defined(Y_BED_SIZE)
#define Y_BED_SIZE Y_MAX_LENGTH
#endif
#if LINEAR_AXES >= 4 && !defined(I_BED_SIZE)
#if HAS_I_AXIS && !defined(I_BED_SIZE)
#define I_BED_SIZE I_MAX_LENGTH
#endif
#if LINEAR_AXES >= 5 && !defined(J_BED_SIZE)
#if HAS_J_AXIS && !defined(J_BED_SIZE)
#define J_BED_SIZE J_MAX_LENGTH
#endif
#if LINEAR_AXES >= 6 && !defined(K_BED_SIZE)
#if HAS_K_AXIS && !defined(K_BED_SIZE)
#define K_BED_SIZE K_MAX_LENGTH
#endif
@ -134,13 +134,13 @@
#if HAS_Y_AXIS
#define _Y_HALF_BED ((Y_BED_SIZE) / 2)
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#define _I_HALF_IMAX ((I_BED_SIZE) / 2)
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#define _J_HALF_JMAX ((J_BED_SIZE) / 2)
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#define _K_HALF_KMAX ((K_BED_SIZE) / 2)
#endif
@ -149,13 +149,13 @@
#define Y_CENTER TERN(BED_CENTER_AT_0_0, 0, _Y_HALF_BED)
#define XY_CENTER { X_CENTER, Y_CENTER }
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#define I_CENTER TERN(BED_CENTER_AT_0_0, 0, _I_HALF_BED)
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#define J_CENTER TERN(BED_CENTER_AT_0_0, 0, _J_HALF_BED)
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#define K_CENTER TERN(BED_CENTER_AT_0_0, 0, _K_HALF_BED)
#endif
@ -166,15 +166,15 @@
#define Y_MIN_BED (Y_CENTER - _Y_HALF_BED)
#define Y_MAX_BED (Y_MIN_BED + Y_BED_SIZE)
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#define I_MINIM (I_CENTER - _I_HALF_BED_SIZE)
#define I_MAXIM (I_MINIM + I_BED_SIZE)
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#define J_MINIM (J_CENTER - _J_HALF_BED_SIZE)
#define J_MAXIM (J_MINIM + J_BED_SIZE)
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#define K_MINIM (K_CENTER - _K_HALF_BED_SIZE)
#define K_MAXIM (K_MINIM + K_BED_SIZE)
#endif
@ -253,21 +253,21 @@
#define Z_HOME_POS TERN(Z_HOME_TO_MIN, Z_MIN_POS, Z_MAX_POS)
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#ifdef MANUAL_I_HOME_POS
#define I_HOME_POS MANUAL_I_HOME_POS
#else
#define I_HOME_POS TERN(I_HOME_TO_MIN, I_MIN_POS, I_MAX_POS)
#endif
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#ifdef MANUAL_J_HOME_POS
#define J_HOME_POS MANUAL_J_HOME_POS
#else
#define J_HOME_POS TERN(J_HOME_TO_MIN, J_MIN_POS, J_MAX_POS)
#endif
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#ifdef MANUAL_K_HOME_POS
#define K_HOME_POS MANUAL_K_HOME_POS
#else
@ -745,7 +745,7 @@
#define LIB_INTERNAL_MAX31865 1
#endif
#endif //HAS_MAX_TC
#endif // HAS_MAX_TC
/**
* X_DUAL_ENDSTOPS endstop reassignment
@ -1620,7 +1620,7 @@
#endif
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#if PIN_EXISTS(I_ENABLE) || AXIS_IS_L64XX(I) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(I))
#define HAS_I_ENABLE 1
#endif
@ -1640,7 +1640,7 @@
#undef DISABLE_INACTIVE_I
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#if PIN_EXISTS(J_ENABLE) || AXIS_IS_L64XX(J) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(J))
#define HAS_J_ENABLE 1
#endif
@ -1660,7 +1660,7 @@
#undef DISABLE_INACTIVE_J
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#if PIN_EXISTS(K_ENABLE) || AXIS_IS_L64XX(K) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(K))
#define HAS_K_ENABLE 1
#endif

View File

@ -1416,7 +1416,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/**
* Allow only extra axis codes that do not conflict with G-code parameter names
*/
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#if AXIS4_NAME != 'A' && AXIS4_NAME != 'B' && AXIS4_NAME != 'C' && AXIS4_NAME != 'U' && AXIS4_NAME != 'V' && AXIS4_NAME != 'W'
#error "AXIS4_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
#elif !defined(I_MIN_POS) || !defined(I_MAX_POS)
@ -1427,7 +1427,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "I_ENABLE_ON is required for your I driver with LINEAR_AXES >= 4."
#endif
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#if AXIS5_NAME == AXIS4_NAME
#error "AXIS5_NAME must be unique."
#elif AXIS5_NAME != 'A' && AXIS5_NAME != 'B' && AXIS5_NAME != 'C' && AXIS5_NAME != 'U' && AXIS5_NAME != 'V' && AXIS5_NAME != 'W'
@ -1440,7 +1440,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "J_ENABLE_ON is required for your J driver with LINEAR_AXES >= 5."
#endif
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#if AXIS6_NAME == AXIS5_NAME || AXIS6_NAME == AXIS4_NAME
#error "AXIS6_NAME must be unique."
#elif AXIS6_NAME != 'A' && AXIS6_NAME != 'B' && AXIS6_NAME != 'C' && AXIS6_NAME != 'U' && AXIS6_NAME != 'V' && AXIS6_NAME != 'W'
@ -2399,13 +2399,13 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#if _AXIS_PLUG_UNUSED_TEST(Z)
#error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG."
#endif
#if LINEAR_AXES >= 4 && _AXIS_PLUG_UNUSED_TEST(I)
#if HAS_I_AXIS && _AXIS_PLUG_UNUSED_TEST(I)
#error "You must enable USE_IMIN_PLUG or USE_IMAX_PLUG."
#endif
#if LINEAR_AXES >= 5 && _AXIS_PLUG_UNUSED_TEST(J)
#if HAS_J_AXIS && _AXIS_PLUG_UNUSED_TEST(J)
#error "You must enable USE_JMIN_PLUG or USE_JMAX_PLUG."
#endif
#if LINEAR_AXES >= 6 && _AXIS_PLUG_UNUSED_TEST(K)
#if HAS_K_AXIS && _AXIS_PLUG_UNUSED_TEST(K)
#error "You must enable USE_KMIN_PLUG or USE_KMAX_PLUG."
#endif
@ -2419,17 +2419,17 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "Enable USE_YMIN_PLUG when homing Y to MIN."
#elif Y_HOME_TO_MAX && DISABLED(USE_YMAX_PLUG)
#error "Enable USE_YMAX_PLUG when homing Y to MAX."
#elif LINEAR_AXES >= 4 && I_HOME_TO_MIN && DISABLED(USE_IMIN_PLUG)
#elif HAS_I_AXIS && I_HOME_TO_MIN && DISABLED(USE_IMIN_PLUG)
#error "Enable USE_IMIN_PLUG when homing I to MIN."
#elif LINEAR_AXES >= 4 && I_HOME_TO_MAX && DISABLED(USE_IMAX_PLUG)
#elif HAS_I_AXIS && I_HOME_TO_MAX && DISABLED(USE_IMAX_PLUG)
#error "Enable USE_IMAX_PLUG when homing I to MAX."
#elif LINEAR_AXES >= 5 && J_HOME_TO_MIN && DISABLED(USE_JMIN_PLUG)
#elif HAS_J_AXIS && J_HOME_TO_MIN && DISABLED(USE_JMIN_PLUG)
#error "Enable USE_JMIN_PLUG when homing J to MIN."
#elif LINEAR_AXES >= 5 && J_HOME_TO_MAX && DISABLED(USE_JMAX_PLUG)
#elif HAS_J_AXIS && J_HOME_TO_MAX && DISABLED(USE_JMAX_PLUG)
#error "Enable USE_JMAX_PLUG when homing J to MAX."
#elif LINEAR_AXES >= 6 && K_HOME_TO_MIN && DISABLED(USE_KMIN_PLUG)
#elif HAS_K_AXIS && K_HOME_TO_MIN && DISABLED(USE_KMIN_PLUG)
#error "Enable USE_KMIN_PLUG when homing K to MIN."
#elif LINEAR_AXES >= 6 && K_HOME_TO_MAX && DISABLED(USE_KMAX_PLUG)
#elif HAS_K_AXIS && K_HOME_TO_MAX && DISABLED(USE_KMAX_PLUG)
#error "Enable USE_KMAX_PLUG when homing K to MAX."
#endif
#endif
@ -2954,11 +2954,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "TMC2208 or TMC2209 on E6 requires E6_HARDWARE_SERIAL or E6_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(E7)
#error "TMC2208 or TMC2209 on E7 requires E7_HARDWARE_SERIAL or E7_SERIAL_(RX|TX)_PIN."
#elif LINEAR_AXES >= 4 && INVALID_TMC_UART(I)
#elif HAS_I_AXIS && INVALID_TMC_UART(I)
#error "TMC2208 or TMC2209 on I requires I_HARDWARE_SERIAL or I_SERIAL_(RX|TX)_PIN."
#elif LINEAR_AXES >= 5 && INVALID_TMC_UART(J)
#elif HAS_J_AXIS && INVALID_TMC_UART(J)
#error "TMC2208 or TMC2209 on J requires J_HARDWARE_SERIAL or J_SERIAL_(RX|TX)_PIN."
#elif LINEAR_AXES >= 6 && INVALID_TMC_UART(K)
#elif HAS_K_AXIS && INVALID_TMC_UART(K)
#error "TMC2208 or TMC2209 on K requires K_HARDWARE_SERIAL or K_SERIAL_(RX|TX)_PIN."
#endif
#undef INVALID_TMC_UART
@ -3044,11 +3044,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
INVALID_TMC_MS(E6)
#elif !TMC_MICROSTEP_IS_VALID(E7)
INVALID_TMC_MS(E7)
#elif LINEAR_AXES >= 4 && !TMC_MICROSTEP_IS_VALID(I)
#elif HAS_I_AXIS && !TMC_MICROSTEP_IS_VALID(I)
INVALID_TMC_MS(I)
#elif LINEAR_AXES >= 5 && !TMC_MICROSTEP_IS_VALID(J)
#elif HAS_J_AXIS && !TMC_MICROSTEP_IS_VALID(J)
INVALID_TMC_MS(J)
#elif LINEAR_AXES >= 6 && !TMC_MICROSTEP_IS_VALID(K)
#elif HAS_K_AXIS && !TMC_MICROSTEP_IS_VALID(K)
INVALID_TMC_MS(K)
#endif
#undef INVALID_TMC_MS
@ -3070,13 +3070,13 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#define X_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(X,TMC2209)
#define Y_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Y,TMC2209)
#define Z_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Z,TMC2209)
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#define I_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(I,TMC2209)
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#define J_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(J,TMC2209)
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#define K_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(K,TMC2209)
#endif
@ -3093,17 +3093,17 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN."
#elif Z_SENSORLESS && Z_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_ZMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX."
#elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_IMIN)
#elif ALL(HAS_I_AXIS, I_SENSORLESS, I_HOME_TO_MIN) && DISABLED(ENDSTOPPULLUP_IMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_IMIN (or ENDSTOPPULLUPS) when homing to I_MIN."
#elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_IMAX)
#elif ALL(HAS_I_AXIS, I_SENSORLESS, I_HOME_TO_MAX) && DISABLED(ENDSTOPPULLUP_IMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_IMAX (or ENDSTOPPULLUPS) when homing to I_MAX."
#elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_JMIN)
#elif ALL(HAS_J_AXIS, J_SENSORLESS, J_HOME_TO_MIN) && DISABLED(ENDSTOPPULLUP_JMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_JMIN (or ENDSTOPPULLUPS) when homing to J_MIN."
#elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_JMAX)
#elif ALL(HAS_J_AXIS, J_SENSORLESS, J_HOME_TO_MAX) && DISABLED(ENDSTOPPULLUP_JMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_JMAX (or ENDSTOPPULLUPS) when homing to J_MAX."
#elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_KMIN)
#elif ALL(HAS_K_AXIS, K_SENSORLESS, K_HOME_TO_MIN) && DISABLED(ENDSTOPPULLUP_KMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMIN (or ENDSTOPPULLUPS) when homing to K_MIN."
#elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_KMAX)
#elif ALL(HAS_K_AXIS, K_SENSORLESS, K_HOME_TO_MAX) && DISABLED(ENDSTOPPULLUP_KMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMAX (or ENDSTOPPULLUPS) when homing to K_MAX."
#endif
#endif
@ -3149,37 +3149,37 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#else
#error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MAX."
#endif
#elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MIN && I_MIN_ENDSTOP_INVERTING != I_ENDSTOP_INVERTING
#elif ALL(HAS_I_AXIS, I_SENSORLESS, I_HOME_TO_MIN) && I_MIN_ENDSTOP_INVERTING != I_ENDSTOP_INVERTING
#if I_ENDSTOP_INVERTING
#error "SENSORLESS_HOMING requires I_MIN_ENDSTOP_INVERTING = true when homing to I_MIN."
#else
#error "SENSORLESS_HOMING requires I_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to I_MIN."
#endif
#elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MAX && I_MAX_ENDSTOP_INVERTING != I_ENDSTOP_INVERTING
#elif ALL(HAS_I_AXIS, I_SENSORLESS, I_HOME_TO_MAX) && I_MAX_ENDSTOP_INVERTING != I_ENDSTOP_INVERTING
#if I_ENDSTOP_INVERTING
#error "SENSORLESS_HOMING requires I_MAX_ENDSTOP_INVERTING = true when homing to I_MAX."
#else
#error "SENSORLESS_HOMING requires I_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to I_MAX."
#endif
#elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MIN && J_MIN_ENDSTOP_INVERTING != J_ENDSTOP_INVERTING
#elif ALL(HAS_J_AXIS, J_SENSORLESS, J_HOME_TO_MIN) && J_MIN_ENDSTOP_INVERTING != J_ENDSTOP_INVERTING
#if J_ENDSTOP_INVERTING
#error "SENSORLESS_HOMING requires J_MIN_ENDSTOP_INVERTING = true when homing to J_MIN."
#else
#error "SENSORLESS_HOMING requires J_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to J_MIN."
#endif
#elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MAX && J_MAX_ENDSTOP_INVERTING != J_ENDSTOP_INVERTING
#elif ALL(HAS_J_AXIS, J_SENSORLESS, J_HOME_TO_MAX) && J_MAX_ENDSTOP_INVERTING != J_ENDSTOP_INVERTING
#if J_ENDSTOP_INVERTING
#error "SENSORLESS_HOMING requires J_MAX_ENDSTOP_INVERTING = true when homing to J_MAX."
#else
#error "SENSORLESS_HOMING requires J_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to J_MAX."
#endif
#elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MIN && K_MIN_ENDSTOP_INVERTING != K_ENDSTOP_INVERTING
#elif ALL(HAS_K_AXIS, K_SENSORLESS, K_HOME_TO_MIN) && K_MIN_ENDSTOP_INVERTING != K_ENDSTOP_INVERTING
#if K_ENDSTOP_INVERTING
#error "SENSORLESS_HOMING requires K_MIN_ENDSTOP_INVERTING = true when homing to K_MIN."
#else
#error "SENSORLESS_HOMING requires K_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to K_MIN."
#endif
#elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MAX && K_MAX_ENDSTOP_INVERTING != K_ENDSTOP_INVERTING
#elif ALL(HAS_K_AXIS, K_SENSORLESS, K_HOME_TO_MAX) && K_MAX_ENDSTOP_INVERTING != K_ENDSTOP_INVERTING
#if K_ENDSTOP_INVERTING
#error "SENSORLESS_HOMING requires K_MAX_ENDSTOP_INVERTING = true when homing to K_MAX."
#else
@ -3303,7 +3303,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/**
* L64XX requirement
*/
#if HAS_L64XX && LINEAR_AXES >= 4
#if HAS_L64XX && HAS_I_AXIS
#error "L64XX requires LINEAR_AXES 3. Homing with L64XX is not yet implemented for LINEAR_AXES > 3."
#endif
@ -3778,17 +3778,17 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
#if _BAD_DRIVER(Z)
#error "Z_DRIVER_TYPE is not recognized."
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#if _BAD_DRIVER(I)
#error "I_DRIVER_TYPE is not recognized."
#endif
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#if _BAD_DRIVER(J)
#error "J_DRIVER_TYPE is not recognized."
#endif
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#if _BAD_DRIVER(K)
#error "K_DRIVER_TYPE is not recognized."
#endif

View File

@ -45,7 +45,7 @@
#if PIN_EXISTS(MT_DET_2)
bool mt_det2_sta;
#endif
#if HAS_X_MIN || HAS_X_MAX
#if X_HOME_DIR
bool endstopx1_sta;
#else
constexpr static bool endstopx1_sta = true;
@ -55,7 +55,7 @@
#else
constexpr static bool endstopx2_sta = true;
#endif
#if HAS_Y_MIN || HAS_Y_MAX
#if HAS_Y_AXIS && Y_HOME_DIR
bool endstopy1_sta;
#else
constexpr static bool endstopy1_sta = true;
@ -65,7 +65,7 @@
#else
constexpr static bool endstopy2_sta = true;
#endif
#if HAS_Z_MIN || HAS_Z_MAX
#if HAS_Z_AXIS && Z_HOME_DIR
bool endstopz1_sta;
#else
constexpr static bool endstopz1_sta = true;

View File

@ -430,25 +430,24 @@ void NextionTFT::PanelInfo(uint8_t req) {
break;
case 36: // Endstop Info
#if HAS_X_MIN
#if X_HOME_TO_MIN
SEND_VALasTXT("x1", READ(X_MIN_PIN) != X_MIN_ENDSTOP_INVERTING ? "triggered" : "open");
#endif
#if HAS_X_MAX
#elif X_HOME_TO_MAX
SEND_VALasTXT("x2", READ(X_MAX_PIN) != X_MAX_ENDSTOP_INVERTING ? "triggered" : "open");
#endif
#if HAS_Y_MIN
#if Y_HOME_TO_MIN
SEND_VALasTXT("y1", READ(Y_MIN_PIN) != Y_MIN_ENDSTOP_INVERTING ? "triggered" : "open");
#elif Y_HOME_TO_MAX
SEND_VALasTXT("y2", READ(X_MAX_PIN) != Y_MAX_ENDSTOP_INVERTING ? "triggered" : "open");
#endif
#if HAS_Z_MIN
#if Z_HOME_TO_MIN
SEND_VALasTXT("z1", READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING ? "triggered" : "open");
#endif
#if HAS_Z_MAX
#elif Z_HOME_TO_MAX
SEND_VALasTXT("z2", READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING ? "triggered" : "open");
#endif
#if HAS_Z2_MIN
SEND_VALasTXT("z2", READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING ? "triggered" : "open");
#endif
#if HAS_Z2_MAX
#elif HAS_Z2_MAX
SEND_VALasTXT("z2", READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING ? "triggered" : "open");
#endif
#if HAS_BED_PROBE

View File

@ -51,13 +51,13 @@ void menu_backlash() {
#if HAS_Z_AXIS && _CAN_CALI(C)
EDIT_BACKLASH_DISTANCE(C);
#endif
#if LINEAR_AXES >= 4 && _CAN_CALI(I)
#if HAS_I_AXIS && _CAN_CALI(I)
EDIT_BACKLASH_DISTANCE(I);
#endif
#if LINEAR_AXES >= 5 && _CAN_CALI(J)
#if HAS_J_AXIS && _CAN_CALI(J)
EDIT_BACKLASH_DISTANCE(J);
#endif
#if LINEAR_AXES >= 6 && _CAN_CALI(K)
#if HAS_K_AXIS && _CAN_CALI(K)
EDIT_BACKLASH_DISTANCE(K);
#endif

View File

@ -97,13 +97,13 @@ void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); }
#if HAS_Z_AXIS
void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); }
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
void lcd_move_i() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_I), I_AXIS); }
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
void lcd_move_j() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_J), J_AXIS); }
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
void lcd_move_k() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_K), K_AXIS); }
#endif
@ -254,13 +254,13 @@ void menu_move() {
#if HAS_Z_AXIS
SUBMENU(MSG_MOVE_Z, []{ _menu_move_distance(Z_AXIS, lcd_move_z); });
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
SUBMENU(MSG_MOVE_I, []{ _menu_move_distance(I_AXIS, lcd_move_i); });
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
SUBMENU(MSG_MOVE_J, []{ _menu_move_distance(J_AXIS, lcd_move_j); });
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
SUBMENU(MSG_MOVE_K, []{ _menu_move_distance(K_AXIS, lcd_move_k); });
#endif
}
@ -345,13 +345,13 @@ void menu_move() {
#if HAS_Z_AXIS
GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, PSTR("G28Z"));
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, PSTR("G28" AXIS4_STR));
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, PSTR("G28" AXIS5_STR));
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, PSTR("G28" AXIS6_STR));
#endif
@ -398,13 +398,13 @@ void menu_motion() {
#if HAS_Z_AXIS
GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, PSTR("G28Z"));
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, PSTR("G28" AXIS4_STR));
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, PSTR("G28" AXIS5_STR));
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, PSTR("G28" AXIS6_STR));
#endif
#endif

View File

@ -497,7 +497,7 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
} break;
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
case AXIS4_NAME: {
position_min = I_center - displacement;
position_max = I_center + displacement;
@ -509,7 +509,7 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
} break;
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
case AXIS5_NAME: {
position_min = J_center - displacement;
position_max = J_center + displacement;
@ -521,7 +521,7 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
} break;
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
case AXIS6_NAME: {
position_min = K_center - displacement;
position_max = K_center + displacement;

View File

@ -1059,7 +1059,7 @@ void Endstops::update() {
}
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
if (stepper.axis_is_moving(I_AXIS)) {
if (stepper.motor_direction(I_AXIS_HEAD)) { // -direction
#if HAS_I_MIN || (I_SPI_SENSORLESS && I_HOME_TO_MIN)
@ -1074,7 +1074,7 @@ void Endstops::update() {
}
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
if (stepper.axis_is_moving(J_AXIS)) {
if (stepper.motor_direction(J_AXIS_HEAD)) { // -direction
#if HAS_J_MIN || (J_SPI_SENSORLESS && J_HOME_TO_MIN)
@ -1089,7 +1089,7 @@ void Endstops::update() {
}
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
if (stepper.axis_is_moving(K_AXIS)) {
if (stepper.motor_direction(K_AXIS_HEAD)) { // -direction
#if HAS_K_MIN || (K_SPI_SENSORLESS && K_HOME_TO_MIN)

View File

@ -603,7 +603,7 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s/*=0.0*/) {
}
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
void do_blocking_move_to_i(const_float_t ri, const_feedRate_t fr_mm_s/*=0.0*/) {
do_blocking_move_to_xyz_i(current_position, ri, fr_mm_s);
}
@ -615,7 +615,7 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s/*=0.0*/) {
}
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
void do_blocking_move_to_j(const_float_t rj, const_feedRate_t fr_mm_s/*=0.0*/) {
do_blocking_move_to_xyzi_j(current_position, rj, fr_mm_s);
}
@ -627,7 +627,7 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s/*=0.0*/) {
}
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
void do_blocking_move_to_k(const_float_t rk, const_feedRate_t fr_mm_s/*=0.0*/) {
do_blocking_move_to_xyzij_k(current_position, rk, fr_mm_s);
}
@ -839,7 +839,7 @@ void restore_feedrate_and_scaling() {
#endif
}
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
if (axis_was_homed(I_AXIS)) {
#if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_I)
NOLESS(target.i, soft_endstop.min.i);
@ -849,7 +849,7 @@ void restore_feedrate_and_scaling() {
#endif
}
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
if (axis_was_homed(J_AXIS)) {
#if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_J)
NOLESS(target.j, soft_endstop.min.j);
@ -859,7 +859,7 @@ void restore_feedrate_and_scaling() {
#endif
}
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
if (axis_was_homed(K_AXIS)) {
#if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_K)
NOLESS(target.k, soft_endstop.min.k);
@ -1417,13 +1417,13 @@ void prepare_line_to_destination() {
#if HAS_Z_AXIS
case Z_AXIS: if (ENABLED(Z_SPI_SENSORLESS)) endstops.tmc_spi_homing.z = true; break;
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
case I_AXIS: if (ENABLED(I_SPI_SENSORLESS)) endstops.tmc_spi_homing.i = true; break;
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
case J_AXIS: if (ENABLED(J_SPI_SENSORLESS)) endstops.tmc_spi_homing.j = true; break;
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
case K_AXIS: if (ENABLED(K_SPI_SENSORLESS)) endstops.tmc_spi_homing.k = true; break;
#endif
default: break;
@ -1494,13 +1494,13 @@ void prepare_line_to_destination() {
#if HAS_Z_AXIS
case Z_AXIS: if (ENABLED(Z_SPI_SENSORLESS)) endstops.tmc_spi_homing.z = false; break;
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
case I_AXIS: if (ENABLED(I_SPI_SENSORLESS)) endstops.tmc_spi_homing.i = false; break;
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
case J_AXIS: if (ENABLED(J_SPI_SENSORLESS)) endstops.tmc_spi_homing.j = false; break;
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
case K_AXIS: if (ENABLED(K_SPI_SENSORLESS)) endstops.tmc_spi_homing.k = false; break;
#endif
default: break;
@ -1821,13 +1821,13 @@ void prepare_line_to_destination() {
case X_AXIS: es = X_ENDSTOP; break;
case Y_AXIS: es = Y_ENDSTOP; break;
case Z_AXIS: es = Z_ENDSTOP; break;
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
case I_AXIS: es = I_ENDSTOP; break;
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
case J_AXIS: es = J_ENDSTOP; break;
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
case K_AXIS: es = K_ENDSTOP; break;
#endif
}

View File

@ -180,19 +180,19 @@ inline float home_bump_mm(const AxisEnum axis) {
TERN_(MAX_SOFTWARE_ENDSTOP_Z, amax = max.z);
break;
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
case I_AXIS:
TERN_(MIN_SOFTWARE_ENDSTOP_I, amin = min.i);
TERN_(MIN_SOFTWARE_ENDSTOP_I, amax = max.i);
break;
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
case J_AXIS:
TERN_(MIN_SOFTWARE_ENDSTOP_J, amin = min.j);
TERN_(MIN_SOFTWARE_ENDSTOP_J, amax = max.j);
break;
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
case K_AXIS:
TERN_(MIN_SOFTWARE_ENDSTOP_K, amin = min.k);
TERN_(MIN_SOFTWARE_ENDSTOP_K, amax = max.k);
@ -333,15 +333,15 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s=0.0f);
#if HAS_Z_AXIS
void do_blocking_move_to_z(const_float_t rz, const_feedRate_t fr_mm_s=0.0f);
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
void do_blocking_move_to_i(const_float_t ri, const_feedRate_t fr_mm_s=0.0f);
void do_blocking_move_to_xyz_i(const xyze_pos_t &raw, const_float_t i, const_feedRate_t fr_mm_s=0.0f);
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
void do_blocking_move_to_j(const_float_t rj, const_feedRate_t fr_mm_s=0.0f);
void do_blocking_move_to_xyzi_j(const xyze_pos_t &raw, const_float_t j, const_feedRate_t fr_mm_s=0.0f);
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
void do_blocking_move_to_k(const_float_t rk, const_feedRate_t fr_mm_s=0.0f);
void do_blocking_move_to_xyzij_k(const xyze_pos_t &raw, const_float_t k, const_feedRate_t fr_mm_s=0.0f);
#endif
@ -476,15 +476,15 @@ void home_if_needed(const bool keeplev=false);
#define LOGICAL_Z_POSITION(POS) NATIVE_TO_LOGICAL(POS, Z_AXIS)
#define RAW_Z_POSITION(POS) LOGICAL_TO_NATIVE(POS, Z_AXIS)
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#define LOGICAL_I_POSITION(POS) NATIVE_TO_LOGICAL(POS, I_AXIS)
#define RAW_I_POSITION(POS) LOGICAL_TO_NATIVE(POS, I_AXIS)
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#define LOGICAL_J_POSITION(POS) NATIVE_TO_LOGICAL(POS, J_AXIS)
#define RAW_J_POSITION(POS) LOGICAL_TO_NATIVE(POS, J_AXIS)
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#define LOGICAL_K_POSITION(POS) NATIVE_TO_LOGICAL(POS, K_AXIS)
#define RAW_K_POSITION(POS) LOGICAL_TO_NATIVE(POS, K_AXIS)
#endif

View File

@ -1866,13 +1866,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
" A:", target.a, " (", da, " steps)"
" B:", target.b, " (", db, " steps)"
" C:", target.c, " (", dc, " steps)"
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
" " AXIS4_STR ":", target.i, " (", di, " steps)"
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
" " AXIS5_STR ":", target.j, " (", dj, " steps)"
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
" " AXIS6_STR ":", target.k, " (", dk, " steps)"
#endif
#if HAS_EXTRUDERS
@ -1939,13 +1939,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
if (db + dc < 0) SBI(dm, B_AXIS); // Motor B direction
if (CORESIGN(db - dc) < 0) SBI(dm, C_AXIS); // Motor C direction
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
if (di < 0) SBI(dm, I_AXIS);
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
if (dj < 0) SBI(dm, J_AXIS);
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
if (dk < 0) SBI(dm, K_AXIS);
#endif
#elif ENABLED(MARKFORGED_XY)
@ -2041,13 +2041,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
steps_dist_mm.b = (db + dc) * mm_per_step[B_AXIS];
steps_dist_mm.c = CORESIGN(db - dc) * mm_per_step[C_AXIS];
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
steps_dist_mm.i = di * mm_per_step[I_AXIS];
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
steps_dist_mm.j = dj * mm_per_step[J_AXIS];
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
steps_dist_mm.k = dk * mm_per_step[K_AXIS];
#endif
#elif ENABLED(MARKFORGED_XY)
@ -2104,7 +2104,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
)
#elif ENABLED(FOAMCUTTER_XYUV)
// Return the largest distance move from either X/Y or I/J plane
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
_MAX(sq(steps_dist_mm.x) + sq(steps_dist_mm.y), sq(steps_dist_mm.i) + sq(steps_dist_mm.j))
#else
sq(steps_dist_mm.x) + sq(steps_dist_mm.y)
@ -2197,13 +2197,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
);
#endif
#if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
if (block->steps.i) stepper.enable_axis(I_AXIS);
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
if (block->steps.j) stepper.enable_axis(J_AXIS);
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
if (block->steps.k) stepper.enable_axis(K_AXIS);
#endif
#endif
@ -2949,17 +2949,17 @@ bool Planner::buffer_segment(const abce_pos_t &abce
SERIAL_ECHOPGM(" (", position.z, "->", target.z);
SERIAL_CHAR(')');
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
SERIAL_ECHOPGM_P(SP_I_LBL, abce.i);
SERIAL_ECHOPGM(" (", position.i, "->", target.i);
SERIAL_CHAR(')');
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
SERIAL_ECHOPGM_P(SP_J_LBL, abce.j);
SERIAL_ECHOPGM(" (", position.j, "->", target.j);
SERIAL_CHAR(')');
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
SERIAL_ECHOPGM_P(SP_K_LBL, abce.k);
SERIAL_ECHOPGM(" (", position.k, "->", target.k);
SERIAL_CHAR(')');

View File

@ -2712,13 +2712,13 @@ void MarlinSettings::reset() {
#if HAS_Z_AXIS && !defined(DEFAULT_ZJERK)
#define DEFAULT_ZJERK 0
#endif
#if LINEAR_AXES >= 4 && !defined(DEFAULT_IJERK)
#if HAS_I_AXIS && !defined(DEFAULT_IJERK)
#define DEFAULT_IJERK 0
#endif
#if LINEAR_AXES >= 5 && !defined(DEFAULT_JJERK)
#if HAS_J_AXIS && !defined(DEFAULT_JJERK)
#define DEFAULT_JJERK 0
#endif
#if LINEAR_AXES >= 6 && !defined(DEFAULT_KJERK)
#if HAS_K_AXIS && !defined(DEFAULT_KJERK)
#define DEFAULT_KJERK 0
#endif
planner.max_jerk.set(

View File

@ -435,15 +435,15 @@ xyze_int8_t Stepper::count_direction{0};
#define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v)
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#define I_APPLY_DIR(v,Q) I_DIR_WRITE(v)
#define I_APPLY_STEP(v,Q) I_STEP_WRITE(v)
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#define J_APPLY_DIR(v,Q) J_DIR_WRITE(v)
#define J_APPLY_STEP(v,Q) J_STEP_WRITE(v)
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#define K_APPLY_DIR(v,Q) K_DIR_WRITE(v)
#define K_APPLY_STEP(v,Q) K_STEP_WRITE(v)
#endif
@ -1688,7 +1688,7 @@ void Stepper::pulse_phase_isr() {
const bool is_page = IS_PAGE(current_block);
#if ENABLED(DIRECT_STEPPING)
// TODO (DerAndere): Add support for LINEAR_AXES >= 4
// TODO (DerAndere): Add support for HAS_I_AXIS
if (is_page) {
#if STEPPER_PAGE_FORMAT == SP_4x4D_128
@ -1929,7 +1929,7 @@ uint32_t Stepper::block_phase_isr() {
// If current block is finished, reset pointer and finalize state
if (step_events_completed >= step_event_count) {
#if ENABLED(DIRECT_STEPPING)
// TODO (DerAndere): Add support for LINEAR_AXES >= 4
// TODO (DerAndere): Add support for HAS_I_AXIS
#if STEPPER_PAGE_FORMAT == SP_4x4D_128
#define PAGE_SEGMENT_UPDATE_POS(AXIS) \
count_position[_AXIS(AXIS)] += page_step_state.bd[_AXIS(AXIS)] - 128 * 7;
@ -3184,13 +3184,13 @@ void Stepper::report_positions() {
} break;
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
case I_AXIS: BABYSTEP_AXIS(I, 0, direction); break;
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
case J_AXIS: BABYSTEP_AXIS(J, 0, direction); break;
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
case K_AXIS: BABYSTEP_AXIS(K, 0, direction); break;
#endif

View File

@ -206,7 +206,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#endif
// I Stepper
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#ifndef I_ENABLE_INIT
#define I_ENABLE_INIT() SET_OUTPUT(I_ENABLE_PIN)
#define I_ENABLE_WRITE(STATE) WRITE(I_ENABLE_PIN,STATE)
@ -225,7 +225,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#endif
// J Stepper
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#ifndef J_ENABLE_INIT
#define J_ENABLE_INIT() SET_OUTPUT(J_ENABLE_PIN)
#define J_ENABLE_WRITE(STATE) WRITE(J_ENABLE_PIN,STATE)
@ -244,7 +244,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#endif
// K Stepper
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#ifndef K_ENABLE_INIT
#define K_ENABLE_INIT() SET_OUTPUT(K_ENABLE_PIN)
#define K_ENABLE_WRITE(STATE) WRITE(K_ENABLE_PIN,STATE)
@ -895,21 +895,21 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#define Z_RESET()
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#define ENABLE_AXIS_I() if (SHOULD_ENABLE(i)) { ENABLE_STEPPER_I(); AFTER_CHANGE(i, true); }
#define DISABLE_AXIS_I() if (SHOULD_DISABLE(i)) { DISABLE_STEPPER_I(); AFTER_CHANGE(i, false); set_axis_untrusted(I_AXIS); }
#else
#define ENABLE_AXIS_I() NOOP
#define DISABLE_AXIS_I() NOOP
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#define ENABLE_AXIS_J() if (SHOULD_ENABLE(j)) { ENABLE_STEPPER_J(); AFTER_CHANGE(j, true); }
#define DISABLE_AXIS_J() if (SHOULD_DISABLE(j)) { DISABLE_STEPPER_J(); AFTER_CHANGE(j, false); set_axis_untrusted(J_AXIS); }
#else
#define ENABLE_AXIS_J() NOOP
#define DISABLE_AXIS_J() NOOP
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#define ENABLE_AXIS_K() if (SHOULD_ENABLE(k)) { ENABLE_STEPPER_K(); AFTER_CHANGE(k, true); }
#define DISABLE_AXIS_K() if (SHOULD_DISABLE(k)) { DISABLE_STEPPER_K(); AFTER_CHANGE(k, false); set_axis_untrusted(K_AXIS); }
#else

View File

@ -83,13 +83,13 @@
#if HAS_Z_AXIS && !defined(CHOPPER_TIMING_Z)
#define CHOPPER_TIMING_Z CHOPPER_TIMING
#endif
#if LINEAR_AXES >= 4 && !defined(CHOPPER_TIMING_I)
#if HAS_I_AXIS && !defined(CHOPPER_TIMING_I)
#define CHOPPER_TIMING_I CHOPPER_TIMING
#endif
#if LINEAR_AXES >= 5 && !defined(CHOPPER_TIMING_J)
#if HAS_J_AXIS && !defined(CHOPPER_TIMING_J)
#define CHOPPER_TIMING_J CHOPPER_TIMING
#endif
#if LINEAR_AXES >= 6 && !defined(CHOPPER_TIMING_K)
#if HAS_K_AXIS && !defined(CHOPPER_TIMING_K)
#define CHOPPER_TIMING_K CHOPPER_TIMING
#endif
#if HAS_EXTRUDERS && !defined(CHOPPER_TIMING_E)

View File

@ -228,7 +228,7 @@
#define PS_ON_PIN P2_12 // (12)
#if !defined(TEMP_0_CS_PIN) && DISABLED(USE_ZMAX_PLUG)
#if !defined(TEMP_0_CS_PIN) && !(HAS_Z_AXIS && Z_HOME_DIR)
#define TEMP_0_CS_PIN P1_28
#endif

View File

@ -477,7 +477,7 @@
#endif
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#ifdef I_STOP_PIN
#if I_HOME_TO_MIN
#define I_MIN_PIN I_STOP_PIN
@ -500,7 +500,7 @@
#undef I_MAX_PIN
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#ifdef J_STOP_PIN
#if J_HOME_TO_MIN
#define J_MIN_PIN J_STOP_PIN
@ -523,7 +523,7 @@
#undef J_MAX_PIN
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#ifdef K_STOP_PIN
#if K_HOME_TO_MIN
#define K_MIN_PIN K_STOP_PIN
@ -1027,12 +1027,12 @@
#endif
// The I axis, if any, should be the next open extruder port
#if LINEAR_AXES >= 4 && !defined(I_DIAG_PIN) && !defined(I_STEP_PIN) && !PIN_EXISTS(I_CS_PIN)
#if HAS_I_AXIS && !defined(I_DIAG_PIN) && !defined(I_STEP_PIN) && !PIN_EXISTS(I_CS_PIN)
#define J_E_INDEX INCREMENT(I_E_INDEX)
#else
#define J_E_INDEX I_E_INDEX
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#ifndef I_STEP_PIN
#define I_STEP_PIN _EPIN(I_E_INDEX, STEP)
#define I_DIR_PIN _EPIN(I_E_INDEX, DIR)
@ -1112,12 +1112,12 @@
#endif
// The J axis, if any, should be the next open extruder port
#if LINEAR_AXES >= 5 && !defined(J_DIAG_PIN) && !defined(J_STEP_PIN) && !PIN_EXISTS(J_CS_PIN)
#if HAS_J_AXIS && !defined(J_DIAG_PIN) && !defined(J_STEP_PIN) && !PIN_EXISTS(J_CS_PIN)
#define K_E_INDEX INCREMENT(J_E_INDEX)
#else
#define K_E_INDEX J_E_INDEX
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#ifndef J_STEP_PIN
#define J_STEP_PIN _EPIN(J_E_INDEX, STEP)
#define J_DIR_PIN _EPIN(J_E_INDEX, DIR)
@ -1197,7 +1197,7 @@
#endif
// The K axis, if any, should be the next open extruder port
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#ifndef K_STEP_PIN
#define K_STEP_PIN _EPIN(K_E_INDEX, STEP)
#define K_DIR_PIN _EPIN(K_E_INDEX, DIR)

View File

@ -55,7 +55,6 @@
#define X_MIN_PIN 12 // X-
#define Y_MIN_PIN 11 // Y-
#define Z_MIN_PIN 10 // Z-
#define X_MAX_PIN 81 // X+
#define Y_MAX_PIN 57 // Y+
@ -78,15 +77,16 @@
#endif
#if ENABLED(BLTOUCH)
#define Z_MIN_PIN 11 // Y-MIN
#define SERVO0_PIN 10 // Z-MIN
#else
#define Z_MIN_PIN 10
#define Z_MIN_PIN 11 // Y-
#define SERVO0_PIN 10 // Z-
#endif
#endif
#define Z_MAX_PIN 7
#ifndef Z_MIN_PIN 7
#define Z_MIN_PIN 10 // Z-
#endif
//
// Z Probe (when not Z_MIN_PIN)

View File

@ -117,10 +117,6 @@
//#define E3_MS2_PIN ?
//#define E3_MS3_PIN ?
#if USES_Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 49
#endif
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN Y_MIN_PIN
#endif

View File

@ -53,13 +53,6 @@
#define Z_MIN_PIN 47
#define Z_MAX_PIN 43
//
// Z Probe (when not Z_MIN_PIN)
//
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 49
#endif
//
// Steppers
//
@ -105,7 +98,7 @@
#define E2_CS_PIN 61
#endif
#if USES_Z_MIN_PROBE_PIN
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 49
#endif

View File

@ -155,7 +155,7 @@
#endif
#if LINEAR_AXES >= 4
#if HAS_I_AXIS
#if PIN_EXISTS(I_MIN)
#define _I_MIN I_MIN_PIN,
@ -201,7 +201,7 @@
#endif
#if LINEAR_AXES >= 5
#if HAS_J_AXIS
#if PIN_EXISTS(J_MIN)
#define _J_MIN J_MIN_PIN,
@ -247,7 +247,7 @@
#endif
#if LINEAR_AXES >= 6
#if HAS_K_AXIS
#if PIN_EXISTS(K_MIN)
#define _K_MIN K_MIN_PIN,

View File

@ -44,14 +44,13 @@
#define X_MAX_PIN 59
#define Y_MIN_PIN 60
#define Y_MAX_PIN 61
#define Z_MIN_PIN 62
#define Z_MAX_PIN 63
#else
#define X_STOP_PIN 36
#define Y_STOP_PIN 39
#define Z_MIN_PIN 62
#define Z_MAX_PIN 42
#endif
#define Z_MIN_PIN 62
//
// Z Probe (when not Z_MIN_PIN)