🎨 Fix L64xx enable, clean up conditionals

This commit is contained in:
Scott Lahteine
2021-09-21 06:25:13 -05:00
parent a37580e4e8
commit ea3df94213
14 changed files with 256 additions and 356 deletions

View File

@ -94,6 +94,8 @@
#endif
#if HAS_Z_AXIS
#define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS))
#else
#undef CONTROLLER_FAN_USE_Z_ONLY
#endif
#if LINEAR_AXES >= 4
#define I_MAX_LENGTH (I_MAX_POS - (I_MIN_POS))
@ -465,31 +467,6 @@
#define NO_LCD_REINIT 1 // Suppress LCD re-initialization
#endif
/**
* Set defaults for missing (newer) options
*/
#ifndef DISABLE_INACTIVE_X
#define DISABLE_INACTIVE_X DISABLE_X
#endif
#if HAS_Y_AXIS && !defined(DISABLE_INACTIVE_Y)
#define DISABLE_INACTIVE_Y DISABLE_Y
#endif
#if HAS_Z_AXIS && !defined(DISABLE_INACTIVE_Z)
#define DISABLE_INACTIVE_Z DISABLE_Z
#endif
#ifndef DISABLE_INACTIVE_E
#define DISABLE_INACTIVE_E DISABLE_E
#endif
#if LINEAR_AXES >= 4 && !defined(DISABLE_INACTIVE_I)
#define DISABLE_INACTIVE_I DISABLE_I
#endif
#if LINEAR_AXES >= 5 && !defined(DISABLE_INACTIVE_J)
#define DISABLE_INACTIVE_J DISABLE_J
#endif
#if LINEAR_AXES >= 6 && !defined(DISABLE_INACTIVE_K)
#define DISABLE_INACTIVE_K DISABLE_K
#endif
/**
* Power Supply
*/
@ -1463,7 +1440,7 @@
#define HAS_X_MS_PINS 1
#endif
#if PIN_EXISTS(X2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2))
#if PIN_EXISTS(X2_ENABLE) || AXIS_IS_L64XX(X2) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2))
#define HAS_X2_ENABLE 1
#endif
#if PIN_EXISTS(X2_DIR)
@ -1476,8 +1453,15 @@
#define HAS_X2_MS_PINS 1
#endif
/**
* Set defaults for missing (newer) options
*/
#if !defined(DISABLE_INACTIVE_X) && ENABLED(DISABLE_X)
#define DISABLE_INACTIVE_X 1
#endif
#if HAS_Y_AXIS
#if PIN_EXISTS(Y_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y))
#if PIN_EXISTS(Y_ENABLE) || AXIS_IS_L64XX(Y) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y))
#define HAS_Y_ENABLE 1
#endif
#if PIN_EXISTS(Y_DIR)
@ -1490,7 +1474,7 @@
#define HAS_Y_MS_PINS 1
#endif
#if PIN_EXISTS(Y2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2))
#if PIN_EXISTS(Y2_ENABLE) || AXIS_IS_L64XX(Y2) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2))
#define HAS_Y2_ENABLE 1
#endif
#if PIN_EXISTS(Y2_DIR)
@ -1502,10 +1486,15 @@
#if PIN_EXISTS(Y2_MS1)
#define HAS_Y2_MS_PINS 1
#endif
#if !defined(DISABLE_INACTIVE_Y) && ENABLED(DISABLE_Y)
#define DISABLE_INACTIVE_Y 1
#endif
#else
#undef DISABLE_INACTIVE_Y
#endif
#if HAS_Z_AXIS
#if PIN_EXISTS(Z_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z))
#if PIN_EXISTS(Z_ENABLE) || AXIS_IS_L64XX(Z) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z))
#define HAS_Z_ENABLE 1
#endif
#if PIN_EXISTS(Z_DIR)
@ -1517,10 +1506,15 @@
#if PIN_EXISTS(Z_MS1)
#define HAS_Z_MS_PINS 1
#endif
#if !defined(DISABLE_INACTIVE_Z) && ENABLED(DISABLE_Z)
#define DISABLE_INACTIVE_Z 1
#endif
#else
#undef DISABLE_INACTIVE_Z
#endif
#if NUM_Z_STEPPER_DRIVERS >= 2
#if PIN_EXISTS(Z2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2))
#if PIN_EXISTS(Z2_ENABLE) || AXIS_IS_L64XX(Z2) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2))
#define HAS_Z2_ENABLE 1
#endif
#if PIN_EXISTS(Z2_DIR)
@ -1535,7 +1529,7 @@
#endif
#if NUM_Z_STEPPER_DRIVERS >= 3
#if PIN_EXISTS(Z3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3))
#if PIN_EXISTS(Z3_ENABLE) || AXIS_IS_L64XX(Z3) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3))
#define HAS_Z3_ENABLE 1
#endif
#if PIN_EXISTS(Z3_DIR)
@ -1550,7 +1544,7 @@
#endif
#if NUM_Z_STEPPER_DRIVERS >= 4
#if PIN_EXISTS(Z4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4))
#if PIN_EXISTS(Z4_ENABLE) || AXIS_IS_L64XX(Z4) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4))
#define HAS_Z4_ENABLE 1
#endif
#if PIN_EXISTS(Z4_DIR)
@ -1565,7 +1559,7 @@
#endif
#if LINEAR_AXES >= 4
#if PIN_EXISTS(I_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(I))
#if PIN_EXISTS(I_ENABLE) || AXIS_IS_L64XX(I) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(I))
#define HAS_I_ENABLE 1
#endif
#if PIN_EXISTS(I_DIR)
@ -1577,10 +1571,15 @@
#if PIN_EXISTS(I_MS1)
#define HAS_I_MS_PINS 1
#endif
#if !defined(DISABLE_INACTIVE_I) && ENABLED(DISABLE_I)
#define DISABLE_INACTIVE_I 1
#endif
#else
#undef DISABLE_INACTIVE_I
#endif
#if LINEAR_AXES >= 5
#if PIN_EXISTS(J_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(J))
#if PIN_EXISTS(J_ENABLE) || AXIS_IS_L64XX(J) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(J))
#define HAS_J_ENABLE 1
#endif
#if PIN_EXISTS(J_DIR)
@ -1592,10 +1591,15 @@
#if PIN_EXISTS(J_MS1)
#define HAS_J_MS_PINS 1
#endif
#if !defined(DISABLE_INACTIVE_J) && ENABLED(DISABLE_J)
#define DISABLE_INACTIVE_J 1
#endif
#else
#undef DISABLE_INACTIVE_J
#endif
#if LINEAR_AXES >= 6
#if PIN_EXISTS(K_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(K))
#if PIN_EXISTS(K_ENABLE) || AXIS_IS_L64XX(K) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(K))
#define HAS_K_ENABLE 1
#endif
#if PIN_EXISTS(K_DIR)
@ -1607,12 +1611,17 @@
#if PIN_EXISTS(K_MS1)
#define HAS_K_MS_PINS 1
#endif
#if !defined(DISABLE_INACTIVE_K) && ENABLED(DISABLE_K)
#define DISABLE_INACTIVE_K 1
#endif
#else
#undef DISABLE_INACTIVE_K
#endif
// Extruder steppers and solenoids
#if HAS_EXTRUDERS
#if PIN_EXISTS(E0_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0))
#if PIN_EXISTS(E0_ENABLE) || AXIS_IS_L64XX(E0) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0))
#define HAS_E0_ENABLE 1
#endif
#if PIN_EXISTS(E0_DIR)
@ -1628,118 +1637,137 @@
#define HAS_SOLENOID_0 1
#endif
#if PIN_EXISTS(E1_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1))
#define HAS_E1_ENABLE 1
#endif
#if PIN_EXISTS(E1_DIR)
#define HAS_E1_DIR 1
#endif
#if PIN_EXISTS(E1_STEP)
#define HAS_E1_STEP 1
#endif
#if PIN_EXISTS(E1_MS1)
#define HAS_E1_MS_PINS 1
#endif
#if PIN_EXISTS(SOL1)
#define HAS_SOLENOID_1 1
#if E_STEPPERS > 1
#if PIN_EXISTS(E1_ENABLE) || AXIS_IS_L64XX(E1) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1))
#define HAS_E1_ENABLE 1
#endif
#if PIN_EXISTS(E1_DIR)
#define HAS_E1_DIR 1
#endif
#if PIN_EXISTS(E1_STEP)
#define HAS_E1_STEP 1
#endif
#if PIN_EXISTS(E1_MS1)
#define HAS_E1_MS_PINS 1
#endif
#if PIN_EXISTS(SOL1)
#define HAS_SOLENOID_1 1
#endif
#endif
#if PIN_EXISTS(E2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2))
#define HAS_E2_ENABLE 1
#endif
#if PIN_EXISTS(E2_DIR)
#define HAS_E2_DIR 1
#endif
#if PIN_EXISTS(E2_STEP)
#define HAS_E2_STEP 1
#endif
#if PIN_EXISTS(E2_MS1)
#define HAS_E2_MS_PINS 1
#endif
#if PIN_EXISTS(SOL2)
#define HAS_SOLENOID_2 1
#if E_STEPPERS > 2
#if PIN_EXISTS(E2_ENABLE) || AXIS_IS_L64XX(E2) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2))
#define HAS_E2_ENABLE 1
#endif
#if PIN_EXISTS(E2_DIR)
#define HAS_E2_DIR 1
#endif
#if PIN_EXISTS(E2_STEP)
#define HAS_E2_STEP 1
#endif
#if PIN_EXISTS(E2_MS1)
#define HAS_E2_MS_PINS 1
#endif
#if PIN_EXISTS(SOL2)
#define HAS_SOLENOID_2 1
#endif
#endif
#if PIN_EXISTS(E3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3))
#define HAS_E3_ENABLE 1
#endif
#if PIN_EXISTS(E3_DIR)
#define HAS_E3_DIR 1
#endif
#if PIN_EXISTS(E3_STEP)
#define HAS_E3_STEP 1
#endif
#if PIN_EXISTS(E3_MS1)
#define HAS_E3_MS_PINS 1
#endif
#if PIN_EXISTS(SOL3)
#define HAS_SOLENOID_3 1
#if E_STEPPERS > 3
#if PIN_EXISTS(E3_ENABLE) || AXIS_IS_L64XX(E3) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3))
#define HAS_E3_ENABLE 1
#endif
#if PIN_EXISTS(E3_DIR)
#define HAS_E3_DIR 1
#endif
#if PIN_EXISTS(E3_STEP)
#define HAS_E3_STEP 1
#endif
#if PIN_EXISTS(E3_MS1)
#define HAS_E3_MS_PINS 1
#endif
#if PIN_EXISTS(SOL3)
#define HAS_SOLENOID_3 1
#endif
#endif
#if PIN_EXISTS(E4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4))
#define HAS_E4_ENABLE 1
#endif
#if PIN_EXISTS(E4_DIR)
#define HAS_E4_DIR 1
#endif
#if PIN_EXISTS(E4_STEP)
#define HAS_E4_STEP 1
#endif
#if PIN_EXISTS(E4_MS1)
#define HAS_E4_MS_PINS 1
#endif
#if PIN_EXISTS(SOL4)
#define HAS_SOLENOID_4 1
#if E_STEPPERS > 4
#if PIN_EXISTS(E4_ENABLE) || AXIS_IS_L64XX(E4) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4))
#define HAS_E4_ENABLE 1
#endif
#if PIN_EXISTS(E4_DIR)
#define HAS_E4_DIR 1
#endif
#if PIN_EXISTS(E4_STEP)
#define HAS_E4_STEP 1
#endif
#if PIN_EXISTS(E4_MS1)
#define HAS_E4_MS_PINS 1
#endif
#if PIN_EXISTS(SOL4)
#define HAS_SOLENOID_4 1
#endif
#endif
#if PIN_EXISTS(E5_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5))
#define HAS_E5_ENABLE 1
#endif
#if PIN_EXISTS(E5_DIR)
#define HAS_E5_DIR 1
#endif
#if PIN_EXISTS(E5_STEP)
#define HAS_E5_STEP 1
#endif
#if PIN_EXISTS(E5_MS1)
#define HAS_E5_MS_PINS 1
#endif
#if PIN_EXISTS(SOL5)
#define HAS_SOLENOID_5 1
#if E_STEPPERS > 5
#if PIN_EXISTS(E5_ENABLE) || AXIS_IS_L64XX(E5) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5))
#define HAS_E5_ENABLE 1
#endif
#if PIN_EXISTS(E5_DIR)
#define HAS_E5_DIR 1
#endif
#if PIN_EXISTS(E5_STEP)
#define HAS_E5_STEP 1
#endif
#if PIN_EXISTS(E5_MS1)
#define HAS_E5_MS_PINS 1
#endif
#if PIN_EXISTS(SOL5)
#define HAS_SOLENOID_5 1
#endif
#endif
#if PIN_EXISTS(E6_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6))
#define HAS_E6_ENABLE 1
#endif
#if PIN_EXISTS(E6_DIR)
#define HAS_E6_DIR 1
#endif
#if PIN_EXISTS(E6_STEP)
#define HAS_E6_STEP 1
#endif
#if PIN_EXISTS(E6_MS1)
#define HAS_E6_MS_PINS 1
#endif
#if PIN_EXISTS(SOL6)
#define HAS_SOLENOID_6 1
#if E_STEPPERS > 6
#if PIN_EXISTS(E6_ENABLE) || AXIS_IS_L64XX(E6) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6))
#define HAS_E6_ENABLE 1
#endif
#if PIN_EXISTS(E6_DIR)
#define HAS_E6_DIR 1
#endif
#if PIN_EXISTS(E6_STEP)
#define HAS_E6_STEP 1
#endif
#if PIN_EXISTS(E6_MS1)
#define HAS_E6_MS_PINS 1
#endif
#if PIN_EXISTS(SOL6)
#define HAS_SOLENOID_6 1
#endif
#endif
#if PIN_EXISTS(E7_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7))
#define HAS_E7_ENABLE 1
#endif
#if PIN_EXISTS(E7_DIR)
#define HAS_E7_DIR 1
#endif
#if PIN_EXISTS(E7_STEP)
#define HAS_E7_STEP 1
#endif
#if PIN_EXISTS(E7_MS1)
#define HAS_E7_MS_PINS 1
#endif
#if PIN_EXISTS(SOL7)
#define HAS_SOLENOID_7 1
#if E_STEPPERS > 7
#if PIN_EXISTS(E7_ENABLE) || AXIS_IS_L64XX(E7) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7))
#define HAS_E7_ENABLE 1
#endif
#if PIN_EXISTS(E7_DIR)
#define HAS_E7_DIR 1
#endif
#if PIN_EXISTS(E7_STEP)
#define HAS_E7_STEP 1
#endif
#if PIN_EXISTS(E7_MS1)
#define HAS_E7_MS_PINS 1
#endif
#if PIN_EXISTS(SOL7)
#define HAS_SOLENOID_7 1
#endif
#endif
#if !defined(DISABLE_INACTIVE_E) && ENABLED(DISABLE_E)
#define DISABLE_INACTIVE_E 1
#endif
#else
#undef DISABLE_INACTIVE_E
#endif // HAS_EXTRUDERS
//
@ -1992,12 +2020,6 @@
#endif
#endif
#if (HAS_E_DRIVER(TMC2660) \
|| ( E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != X_ENABLE_PIN \
&& E0_ENABLE_PIN != Y_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN ) )
#define HAS_E_STEPPER_ENABLE 1
#endif
#if ANY_AXIS_HAS(HW_SERIAL)
#define HAS_TMC_HW_SERIAL 1
#endif
@ -3255,11 +3277,6 @@
#define SD_SPI_SPEED SPI_FULL_SPEED
#endif
// Defined here to catch the above defines
#if ENABLED(SDCARD_SORT_ALPHA) && (FOLDER_SORTING || ENABLED(SDSORT_GCODE))
#define HAS_FOLDER_SORTING 1
#endif
#if HAS_WIRED_LCD
// Get LCD character width/height, which may be overridden by pins, configs, etc.
#ifndef LCD_WIDTH

View File

@ -2355,46 +2355,30 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#endif
#endif
#if E_STEPPERS
#if !(PINS_EXIST(E0_STEP, E0_DIR) && HAS_E0_ENABLE)
#error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 1
#if !(PINS_EXIST(E1_STEP, E1_DIR) && HAS_E1_ENABLE)
#error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 2
#if !(PINS_EXIST(E2_STEP, E2_DIR) && HAS_E2_ENABLE)
#error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 3
#if !(PINS_EXIST(E3_STEP, E3_DIR) && HAS_E3_ENABLE)
#error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 4
#if !(PINS_EXIST(E4_STEP, E4_DIR) && HAS_E4_ENABLE)
#error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 5
#if !(PINS_EXIST(E5_STEP, E5_DIR) && HAS_E5_ENABLE)
#error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 6
#if !(PINS_EXIST(E6_STEP, E6_DIR) && HAS_E6_ENABLE)
#error "E6_STEP_PIN, E6_DIR_PIN, or E6_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 7
#if !(PINS_EXIST(E7_STEP, E7_DIR) && HAS_E7_ENABLE)
#error "E7_STEP_PIN, E7_DIR_PIN, or E7_ENABLE_PIN not defined for this board."
#endif
#endif // E_STEPPERS > 7
#endif // E_STEPPERS > 6
#endif // E_STEPPERS > 5
#endif // E_STEPPERS > 4
#endif // E_STEPPERS > 3
#endif // E_STEPPERS > 2
#endif // E_STEPPERS > 1
#endif // E_STEPPERS
#if E_STEPPERS > 0 && !(PINS_EXIST(E0_STEP, E0_DIR) && HAS_E0_ENABLE)
#error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 1 && !(PINS_EXIST(E1_STEP, E1_DIR) && HAS_E1_ENABLE)
#error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 2 && !(PINS_EXIST(E2_STEP, E2_DIR) && HAS_E2_ENABLE)
#error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 3 && !(PINS_EXIST(E3_STEP, E3_DIR) && HAS_E3_ENABLE)
#error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 4 && !(PINS_EXIST(E4_STEP, E4_DIR) && HAS_E4_ENABLE)
#error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 5 && !(PINS_EXIST(E5_STEP, E5_DIR) && HAS_E5_ENABLE)
#error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 6 && !(PINS_EXIST(E6_STEP, E6_DIR) && HAS_E6_ENABLE)
#error "E6_STEP_PIN, E6_DIR_PIN, or E6_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 7 && !(PINS_EXIST(E7_STEP, E7_DIR) && HAS_E7_ENABLE)
#error "E7_STEP_PIN, E7_DIR_PIN, or E7_ENABLE_PIN not defined for this board."
#endif
/**
* Endstop Tests