🔧 Base NUM_AXES on defined DRIVER_TYPEs (#24106)
This commit is contained in:
@@ -679,8 +679,29 @@
|
||||
* Number of Linear Axes (e.g., XYZIJKUVW)
|
||||
* All the logical axes except for the tool (E) axis
|
||||
*/
|
||||
#ifndef NUM_AXES
|
||||
#define NUM_AXES XYZ
|
||||
#ifdef NUM_AXES
|
||||
#undef NUM_AXES
|
||||
#define NUM_AXES_WARNING 1
|
||||
#endif
|
||||
|
||||
#ifdef W_DRIVER_TYPE
|
||||
#define NUM_AXES 9
|
||||
#elif defined(V_DRIVER_TYPE)
|
||||
#define NUM_AXES 8
|
||||
#elif defined(U_DRIVER_TYPE)
|
||||
#define NUM_AXES 7
|
||||
#elif defined(K_DRIVER_TYPE)
|
||||
#define NUM_AXES 6
|
||||
#elif defined(J_DRIVER_TYPE)
|
||||
#define NUM_AXES 5
|
||||
#elif defined(I_DRIVER_TYPE)
|
||||
#define NUM_AXES 4
|
||||
#elif defined(Z_DRIVER_TYPE)
|
||||
#define NUM_AXES 3
|
||||
#elif defined(Y_DRIVER_TYPE)
|
||||
#define NUM_AXES 2
|
||||
#else
|
||||
#define NUM_AXES 1
|
||||
#endif
|
||||
#if NUM_AXES >= XY
|
||||
#define HAS_Y_AXIS 1
|
||||
@@ -707,6 +728,147 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if E_STEPPERS <= 0
|
||||
#undef E0_DRIVER_TYPE
|
||||
#endif
|
||||
#if E_STEPPERS <= 1
|
||||
#undef E1_DRIVER_TYPE
|
||||
#endif
|
||||
#if E_STEPPERS <= 2
|
||||
#undef E2_DRIVER_TYPE
|
||||
#endif
|
||||
#if E_STEPPERS <= 3
|
||||
#undef E3_DRIVER_TYPE
|
||||
#endif
|
||||
#if E_STEPPERS <= 4
|
||||
#undef E4_DRIVER_TYPE
|
||||
#endif
|
||||
#if E_STEPPERS <= 5
|
||||
#undef E5_DRIVER_TYPE
|
||||
#endif
|
||||
#if E_STEPPERS <= 6
|
||||
#undef E6_DRIVER_TYPE
|
||||
#endif
|
||||
#if E_STEPPERS <= 7
|
||||
#undef E7_DRIVER_TYPE
|
||||
#endif
|
||||
|
||||
#if !HAS_Y_AXIS
|
||||
#undef ENDSTOPPULLUP_YMIN
|
||||
#undef ENDSTOPPULLUP_YMAX
|
||||
#undef Y_MIN_ENDSTOP_INVERTING
|
||||
#undef Y_MAX_ENDSTOP_INVERTING
|
||||
#undef Y2_DRIVER_TYPE
|
||||
#undef Y_ENABLE_ON
|
||||
#undef DISABLE_Y
|
||||
#undef INVERT_Y_DIR
|
||||
#undef Y_HOME_DIR
|
||||
#undef Y_MIN_POS
|
||||
#undef Y_MAX_POS
|
||||
#undef MANUAL_Y_HOME_POS
|
||||
#endif
|
||||
|
||||
#if !HAS_Z_AXIS
|
||||
#undef ENDSTOPPULLUP_ZMIN
|
||||
#undef ENDSTOPPULLUP_ZMAX
|
||||
#undef Z_MIN_ENDSTOP_INVERTING
|
||||
#undef Z_MAX_ENDSTOP_INVERTING
|
||||
#undef Z2_DRIVER_TYPE
|
||||
#undef Z3_DRIVER_TYPE
|
||||
#undef Z4_DRIVER_TYPE
|
||||
#undef Z_ENABLE_ON
|
||||
#undef DISABLE_Z
|
||||
#undef INVERT_Z_DIR
|
||||
#undef Z_HOME_DIR
|
||||
#undef Z_MIN_POS
|
||||
#undef Z_MAX_POS
|
||||
#undef MANUAL_Z_HOME_POS
|
||||
#endif
|
||||
|
||||
#if !HAS_I_AXIS
|
||||
#undef ENDSTOPPULLUP_IMIN
|
||||
#undef ENDSTOPPULLUP_IMAX
|
||||
#undef I_MIN_ENDSTOP_INVERTING
|
||||
#undef I_MAX_ENDSTOP_INVERTING
|
||||
#undef I_ENABLE_ON
|
||||
#undef DISABLE_I
|
||||
#undef INVERT_I_DIR
|
||||
#undef I_HOME_DIR
|
||||
#undef I_MIN_POS
|
||||
#undef I_MAX_POS
|
||||
#undef MANUAL_I_HOME_POS
|
||||
#endif
|
||||
|
||||
#if !HAS_J_AXIS
|
||||
#undef ENDSTOPPULLUP_JMIN
|
||||
#undef ENDSTOPPULLUP_JMAX
|
||||
#undef J_MIN_ENDSTOP_INVERTING
|
||||
#undef J_MAX_ENDSTOP_INVERTING
|
||||
#undef J_ENABLE_ON
|
||||
#undef DISABLE_J
|
||||
#undef INVERT_J_DIR
|
||||
#undef J_HOME_DIR
|
||||
#undef J_MIN_POS
|
||||
#undef J_MAX_POS
|
||||
#undef MANUAL_J_HOME_POS
|
||||
#endif
|
||||
|
||||
#if !HAS_K_AXIS
|
||||
#undef ENDSTOPPULLUP_KMIN
|
||||
#undef ENDSTOPPULLUP_KMAX
|
||||
#undef K_MIN_ENDSTOP_INVERTING
|
||||
#undef K_MAX_ENDSTOP_INVERTING
|
||||
#undef K_ENABLE_ON
|
||||
#undef DISABLE_K
|
||||
#undef INVERT_K_DIR
|
||||
#undef K_HOME_DIR
|
||||
#undef K_MIN_POS
|
||||
#undef K_MAX_POS
|
||||
#undef MANUAL_K_HOME_POS
|
||||
#endif
|
||||
|
||||
#if !HAS_U_AXIS
|
||||
#undef ENDSTOPPULLUP_UMIN
|
||||
#undef ENDSTOPPULLUP_UMAX
|
||||
#undef U_MIN_ENDSTOP_INVERTING
|
||||
#undef U_MAX_ENDSTOP_INVERTING
|
||||
#undef U_ENABLE_ON
|
||||
#undef DISABLE_U
|
||||
#undef INVERT_U_DIR
|
||||
#undef U_HOME_DIR
|
||||
#undef U_MIN_POS
|
||||
#undef U_MAX_POS
|
||||
#undef MANUAL_U_HOME_POS
|
||||
#endif
|
||||
|
||||
#if !HAS_V_AXIS
|
||||
#undef ENDSTOPPULLUP_VMIN
|
||||
#undef ENDSTOPPULLUP_VMAX
|
||||
#undef V_MIN_ENDSTOP_INVERTING
|
||||
#undef V_MAX_ENDSTOP_INVERTING
|
||||
#undef V_ENABLE_ON
|
||||
#undef DISABLE_V
|
||||
#undef INVERT_V_DIR
|
||||
#undef V_HOME_DIR
|
||||
#undef V_MIN_POS
|
||||
#undef V_MAX_POS
|
||||
#undef MANUAL_V_HOME_POS
|
||||
#endif
|
||||
|
||||
#if !HAS_W_AXIS
|
||||
#undef ENDSTOPPULLUP_WMIN
|
||||
#undef ENDSTOPPULLUP_WMAX
|
||||
#undef W_MIN_ENDSTOP_INVERTING
|
||||
#undef W_MAX_ENDSTOP_INVERTING
|
||||
#undef W_ENABLE_ON
|
||||
#undef DISABLE_W
|
||||
#undef INVERT_W_DIR
|
||||
#undef W_HOME_DIR
|
||||
#undef W_MIN_POS
|
||||
#undef W_MAX_POS
|
||||
#undef MANUAL_W_HOME_POS
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Number of Primary Linear Axes (e.g., XYZ)
|
||||
* X, XY, or XYZ axes. Excluding duplicate axes (X2, Y2. Z2. Z3, Z4)
|
||||
@@ -1214,104 +1376,6 @@
|
||||
#define HAS_ETHERNET 1
|
||||
#endif
|
||||
|
||||
// Fallback Stepper Driver types that don't depend on Configuration_adv.h
|
||||
#ifndef X_DRIVER_TYPE
|
||||
#define X_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#ifndef X2_DRIVER_TYPE
|
||||
#define X2_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#ifndef Y_DRIVER_TYPE
|
||||
#define Y_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#ifndef Y2_DRIVER_TYPE
|
||||
#define Y2_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#ifndef Z_DRIVER_TYPE
|
||||
#define Z_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#ifndef Z2_DRIVER_TYPE
|
||||
#define Z2_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#ifndef Z3_DRIVER_TYPE
|
||||
#define Z3_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#ifndef Z4_DRIVER_TYPE
|
||||
#define Z4_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS <= 0
|
||||
#undef E0_DRIVER_TYPE
|
||||
#elif !defined(E0_DRIVER_TYPE)
|
||||
#define E0_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS <= 1
|
||||
#undef E1_DRIVER_TYPE
|
||||
#elif !defined(E1_DRIVER_TYPE)
|
||||
#define E1_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS <= 2
|
||||
#undef E2_DRIVER_TYPE
|
||||
#elif !defined(E2_DRIVER_TYPE)
|
||||
#define E2_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS <= 3
|
||||
#undef E3_DRIVER_TYPE
|
||||
#elif !defined(E3_DRIVER_TYPE)
|
||||
#define E3_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS <= 4
|
||||
#undef E4_DRIVER_TYPE
|
||||
#elif !defined(E4_DRIVER_TYPE)
|
||||
#define E4_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS <= 5
|
||||
#undef E5_DRIVER_TYPE
|
||||
#elif !defined(E5_DRIVER_TYPE)
|
||||
#define E5_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS <= 6
|
||||
#undef E6_DRIVER_TYPE
|
||||
#elif !defined(E6_DRIVER_TYPE)
|
||||
#define E6_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS <= 7
|
||||
#undef E7_DRIVER_TYPE
|
||||
#elif !defined(E7_DRIVER_TYPE)
|
||||
#define E7_DRIVER_TYPE A4988
|
||||
#endif
|
||||
|
||||
// Fallback axis inverting
|
||||
#ifndef INVERT_X_DIR
|
||||
#define INVERT_X_DIR false
|
||||
#endif
|
||||
#if HAS_Y_AXIS && !defined(INVERT_Y_DIR)
|
||||
#define INVERT_Y_DIR false
|
||||
#endif
|
||||
#if HAS_Z_AXIS && !defined(INVERT_Z_DIR)
|
||||
#define INVERT_Z_DIR false
|
||||
#endif
|
||||
#if HAS_I_AXIS && !defined(INVERT_I_DIR)
|
||||
#define INVERT_I_DIR false
|
||||
#endif
|
||||
#if HAS_J_AXIS && !defined(INVERT_J_DIR)
|
||||
#define INVERT_J_DIR false
|
||||
#endif
|
||||
#if HAS_K_AXIS && !defined(INVERT_K_DIR)
|
||||
#define INVERT_K_DIR false
|
||||
#endif
|
||||
#if HAS_U_AXIS && !defined(INVERT_U_DIR)
|
||||
#define INVERT_U_DIR false
|
||||
#endif
|
||||
#if HAS_V_AXIS && !defined(INVERT_V_DIR)
|
||||
#define INVERT_V_DIR false
|
||||
#endif
|
||||
#if HAS_W_AXIS && !defined(INVERT_W_DIR)
|
||||
#define INVERT_W_DIR false
|
||||
#endif
|
||||
#if HAS_EXTRUDERS && !defined(INVERT_E_DIR)
|
||||
#define INVERT_E_DIR false
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This setting is also used by M109 when trying to calculate
|
||||
* a ballpark safe margin to prevent wait-forever situation.
|
||||
|
||||
Reference in New Issue
Block a user