Handle dependent Stepper Driver defaults later (#19820)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
ellensp 2020-10-21 09:01:46 +13:00 committed by Scott Lahteine
parent c6f17ac01e
commit b1b8161447
2 changed files with 44 additions and 35 deletions

View File

@ -781,77 +781,67 @@
#define HAS_ETHERNET 1 #define HAS_ETHERNET 1
#endif #endif
// Fallback Stepper Driver types // Fallback Stepper Driver types that don't depend on Configuration_adv.h
#ifndef X_DRIVER_TYPE #ifndef X_DRIVER_TYPE
#define X_DRIVER_TYPE A4988 #define X_DRIVER_TYPE A4988
#endif #endif
#ifndef Y_DRIVER_TYPE #ifndef X2_DRIVER_TYPE
#define Y_DRIVER_TYPE A4988
#endif
#ifndef Z_DRIVER_TYPE
#define Z_DRIVER_TYPE A4988
#endif
#if NONE(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
#undef X2_DRIVER_TYPE
#elif !defined(X2_DRIVER_TYPE)
#define X2_DRIVER_TYPE A4988 #define X2_DRIVER_TYPE A4988
#endif #endif
#if DISABLED(Y_DUAL_STEPPER_DRIVERS) #ifndef Y_DRIVER_TYPE
#undef Y2_DRIVER_TYPE #define Y_DRIVER_TYPE A4988
#elif !defined(Y2_DRIVER_TYPE) #endif
#ifndef Y2_DRIVER_TYPE
#define Y2_DRIVER_TYPE A4988 #define Y2_DRIVER_TYPE A4988
#endif #endif
#if NUM_Z_STEPPER_DRIVERS < 2 #ifndef Z_DRIVER_TYPE
#undef Z2_DRIVER_TYPE #define Z_DRIVER_TYPE A4988
#elif !defined(Z2_DRIVER_TYPE) #endif
#ifndef Z2_DRIVER_TYPE
#define Z2_DRIVER_TYPE A4988 #define Z2_DRIVER_TYPE A4988
#endif #endif
#if NUM_Z_STEPPER_DRIVERS < 3 #ifndef Z3_DRIVER_TYPE
#undef Z3_DRIVER_TYPE
#elif !defined(Z3_DRIVER_TYPE)
#define Z3_DRIVER_TYPE A4988 #define Z3_DRIVER_TYPE A4988
#endif #endif
#if NUM_Z_STEPPER_DRIVERS < 4 #ifndef Z4_DRIVER_TYPE
#undef Z4_DRIVER_TYPE
#elif !defined(Z4_DRIVER_TYPE)
#define Z4_DRIVER_TYPE A4988 #define Z4_DRIVER_TYPE A4988
#endif #endif
#if E_STEPPERS < 1 #if E_STEPPERS <= 0
#undef E0_DRIVER_TYPE #undef E0_DRIVER_TYPE
#elif !defined(E0_DRIVER_TYPE) #elif !defined(E0_DRIVER_TYPE)
#define E0_DRIVER_TYPE A4988 #define E0_DRIVER_TYPE A4988
#endif #endif
#if E_STEPPERS < 2 #if E_STEPPERS <= 1
#undef E1_DRIVER_TYPE #undef E1_DRIVER_TYPE
#elif !defined(E1_DRIVER_TYPE) #elif !defined(E1_DRIVER_TYPE)
#define E1_DRIVER_TYPE A4988 #define E1_DRIVER_TYPE A4988
#endif #endif
#if E_STEPPERS < 3 #if E_STEPPERS <= 2
#undef E2_DRIVER_TYPE #undef E2_DRIVER_TYPE
#elif !defined(E2_DRIVER_TYPE) #elif !defined(E2_DRIVER_TYPE)
#define E2_DRIVER_TYPE A4988 #define E2_DRIVER_TYPE A4988
#endif #endif
#if E_STEPPERS < 4 #if E_STEPPERS <= 3
#undef E3_DRIVER_TYPE #undef E3_DRIVER_TYPE
#elif !defined(E3_DRIVER_TYPE) #elif !defined(E3_DRIVER_TYPE)
#define E3_DRIVER_TYPE A4988 #define E3_DRIVER_TYPE A4988
#endif #endif
#if E_STEPPERS < 5 #if E_STEPPERS <= 4
#undef E4_DRIVER_TYPE #undef E4_DRIVER_TYPE
#elif !defined(E4_DRIVER_TYPE) #elif !defined(E4_DRIVER_TYPE)
#define E4_DRIVER_TYPE A4988 #define E4_DRIVER_TYPE A4988
#endif #endif
#if E_STEPPERS < 6 #if E_STEPPERS <= 5
#undef E5_DRIVER_TYPE #undef E5_DRIVER_TYPE
#elif !defined(E5_DRIVER_TYPE) #elif !defined(E5_DRIVER_TYPE)
#define E5_DRIVER_TYPE A4988 #define E5_DRIVER_TYPE A4988
#endif #endif
#if E_STEPPERS < 7 #if E_STEPPERS <= 6
#undef E6_DRIVER_TYPE #undef E6_DRIVER_TYPE
#elif !defined(E6_DRIVER_TYPE) #elif !defined(E6_DRIVER_TYPE)
#define E6_DRIVER_TYPE A4988 #define E6_DRIVER_TYPE A4988
#endif #endif
#if E_STEPPERS < 8 #if E_STEPPERS <= 7
#undef E7_DRIVER_TYPE #undef E7_DRIVER_TYPE
#elif !defined(E7_DRIVER_TYPE) #elif !defined(E7_DRIVER_TYPE)
#define E7_DRIVER_TYPE A4988 #define E7_DRIVER_TYPE A4988

View File

@ -178,16 +178,35 @@
#define HAS_MOTOR_CURRENT_I2C 1 #define HAS_MOTOR_CURRENT_I2C 1
#endif #endif
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
#undef Z_STEPPER_ALIGN_AMP
#endif
#ifndef Z_STEPPER_ALIGN_AMP
#define Z_STEPPER_ALIGN_AMP 1.0
#endif
#endif
// Multiple Z steppers // Multiple Z steppers
#ifndef NUM_Z_STEPPER_DRIVERS #ifndef NUM_Z_STEPPER_DRIVERS
#define NUM_Z_STEPPER_DRIVERS 1 #define NUM_Z_STEPPER_DRIVERS 1
#endif #endif
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) // Fallback Stepper Driver types that depend on Configuration_adv.h
#undef Z_STEPPER_ALIGN_AMP #if NONE(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
#undef X2_DRIVER_TYPE
#endif #endif
#ifndef Z_STEPPER_ALIGN_AMP #if DISABLED(Y_DUAL_STEPPER_DRIVERS)
#define Z_STEPPER_ALIGN_AMP 1.0 #undef Y2_DRIVER_TYPE
#endif
#if NUM_Z_STEPPER_DRIVERS < 2
#undef Z2_DRIVER_TYPE
#endif
#if NUM_Z_STEPPER_DRIVERS < 3
#undef Z3_DRIVER_TYPE
#endif
#if NUM_Z_STEPPER_DRIVERS < 4
#undef Z4_DRIVER_TYPE
#endif #endif
// //