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
#endif
// Fallback Stepper Driver types
// Fallback Stepper Driver types that don't depend on Configuration_adv.h
#ifndef X_DRIVER_TYPE
#define X_DRIVER_TYPE A4988
#define X_DRIVER_TYPE A4988
#endif
#ifndef Y_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)
#ifndef X2_DRIVER_TYPE
#define X2_DRIVER_TYPE A4988
#endif
#if DISABLED(Y_DUAL_STEPPER_DRIVERS)
#undef Y2_DRIVER_TYPE
#elif !defined(Y2_DRIVER_TYPE)
#ifndef Y_DRIVER_TYPE
#define Y_DRIVER_TYPE A4988
#endif
#ifndef Y2_DRIVER_TYPE
#define Y2_DRIVER_TYPE A4988
#endif
#if NUM_Z_STEPPER_DRIVERS < 2
#undef Z2_DRIVER_TYPE
#elif !defined(Z2_DRIVER_TYPE)
#ifndef Z_DRIVER_TYPE
#define Z_DRIVER_TYPE A4988
#endif
#ifndef Z2_DRIVER_TYPE
#define Z2_DRIVER_TYPE A4988
#endif
#if NUM_Z_STEPPER_DRIVERS < 3
#undef Z3_DRIVER_TYPE
#elif !defined(Z3_DRIVER_TYPE)
#ifndef Z3_DRIVER_TYPE
#define Z3_DRIVER_TYPE A4988
#endif
#if NUM_Z_STEPPER_DRIVERS < 4
#undef Z4_DRIVER_TYPE
#elif !defined(Z4_DRIVER_TYPE)
#ifndef Z4_DRIVER_TYPE
#define Z4_DRIVER_TYPE A4988
#endif
#if E_STEPPERS < 1
#if E_STEPPERS <= 0
#undef E0_DRIVER_TYPE
#elif !defined(E0_DRIVER_TYPE)
#define E0_DRIVER_TYPE A4988
#endif
#if E_STEPPERS < 2
#if E_STEPPERS <= 1
#undef E1_DRIVER_TYPE
#elif !defined(E1_DRIVER_TYPE)
#define E1_DRIVER_TYPE A4988
#endif
#if E_STEPPERS < 3
#if E_STEPPERS <= 2
#undef E2_DRIVER_TYPE
#elif !defined(E2_DRIVER_TYPE)
#define E2_DRIVER_TYPE A4988
#endif
#if E_STEPPERS < 4
#if E_STEPPERS <= 3
#undef E3_DRIVER_TYPE
#elif !defined(E3_DRIVER_TYPE)
#define E3_DRIVER_TYPE A4988
#endif
#if E_STEPPERS < 5
#if E_STEPPERS <= 4
#undef E4_DRIVER_TYPE
#elif !defined(E4_DRIVER_TYPE)
#define E4_DRIVER_TYPE A4988
#endif
#if E_STEPPERS < 6
#if E_STEPPERS <= 5
#undef E5_DRIVER_TYPE
#elif !defined(E5_DRIVER_TYPE)
#define E5_DRIVER_TYPE A4988
#endif
#if E_STEPPERS < 7
#if E_STEPPERS <= 6
#undef E6_DRIVER_TYPE
#elif !defined(E6_DRIVER_TYPE)
#define E6_DRIVER_TYPE A4988
#endif
#if E_STEPPERS < 8
#if E_STEPPERS <= 7
#undef E7_DRIVER_TYPE
#elif !defined(E7_DRIVER_TYPE)
#define E7_DRIVER_TYPE A4988

View file

@ -178,16 +178,35 @@
#define HAS_MOTOR_CURRENT_I2C 1
#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
#ifndef NUM_Z_STEPPER_DRIVERS
#define NUM_Z_STEPPER_DRIVERS 1
#endif
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
#undef Z_STEPPER_ALIGN_AMP
// Fallback Stepper Driver types that depend on Configuration_adv.h
#if NONE(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
#undef X2_DRIVER_TYPE
#endif
#ifndef Z_STEPPER_ALIGN_AMP
#define Z_STEPPER_ALIGN_AMP 1.0
#if DISABLED(Y_DUAL_STEPPER_DRIVERS)
#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
//