Browse Source

Fix drivers.h dependency, defer macro evaluation (#11450)

pull/1/head
Scott Lahteine 6 years ago
committed by GitHub
parent
commit
131d216afa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 49
      Marlin/src/core/drivers.h
  2. 2
      Marlin/src/inc/MarlinConfigPre.h

49
Marlin/src/core/drivers.h

@ -44,47 +44,14 @@
#define AXIS_DRIVER_TYPE_X(T) AXIS_DRIVER_TYPE(X,T) #define AXIS_DRIVER_TYPE_X(T) AXIS_DRIVER_TYPE(X,T)
#define AXIS_DRIVER_TYPE_Y(T) AXIS_DRIVER_TYPE(Y,T) #define AXIS_DRIVER_TYPE_Y(T) AXIS_DRIVER_TYPE(Y,T)
#define AXIS_DRIVER_TYPE_Z(T) AXIS_DRIVER_TYPE(Z,T) #define AXIS_DRIVER_TYPE_Z(T) AXIS_DRIVER_TYPE(Z,T)
#define AXIS_DRIVER_TYPE_X2(T) (ENABLED(X_DUAL_STEPPER_DRIVERS) || ENABLED(DUAL_X_CARRIAGE)) && AXIS_DRIVER_TYPE(X2,T)
#if ENABLED(X_DUAL_STEPPER_DRIVERS) || ENABLED(DUAL_X_CARRIAGE) #define AXIS_DRIVER_TYPE_Y2(T) (ENABLED(Y_DUAL_STEPPER_DRIVERS) && AXIS_DRIVER_TYPE(Y2,T))
#define AXIS_DRIVER_TYPE_X2(T) AXIS_DRIVER_TYPE(X2,T) #define AXIS_DRIVER_TYPE_Z2(T) (ENABLED(Z_DUAL_STEPPER_DRIVERS) && AXIS_DRIVER_TYPE(Z2,T))
#else #define AXIS_DRIVER_TYPE_E0(T) (E_STEPPERS > 0 && AXIS_DRIVER_TYPE(E0,T))
#define AXIS_DRIVER_TYPE_X2(T) false #define AXIS_DRIVER_TYPE_E1(T) (E_STEPPERS > 1 && AXIS_DRIVER_TYPE(E1,T))
#endif #define AXIS_DRIVER_TYPE_E2(T) (E_STEPPERS > 2 && AXIS_DRIVER_TYPE(E2,T))
#if ENABLED(Y_DUAL_STEPPER_DRIVERS) #define AXIS_DRIVER_TYPE_E3(T) (E_STEPPERS > 3 && AXIS_DRIVER_TYPE(E3,T))
#define AXIS_DRIVER_TYPE_Y2(T) AXIS_DRIVER_TYPE(Y2,T) #define AXIS_DRIVER_TYPE_E4(T) (E_STEPPERS > 4 && AXIS_DRIVER_TYPE(E4,T))
#else
#define AXIS_DRIVER_TYPE_Y2(T) false
#endif
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
#define AXIS_DRIVER_TYPE_Z2(T) AXIS_DRIVER_TYPE(Z2,T)
#else
#define AXIS_DRIVER_TYPE_Z2(T) false
#endif
#if E_STEPPERS > 0
#define AXIS_DRIVER_TYPE_E0(T) AXIS_DRIVER_TYPE(E0,T)
#else
#define AXIS_DRIVER_TYPE_E0(T) false
#endif
#if E_STEPPERS > 1
#define AXIS_DRIVER_TYPE_E1(T) AXIS_DRIVER_TYPE(E1,T)
#else
#define AXIS_DRIVER_TYPE_E1(T) false
#endif
#if E_STEPPERS > 2
#define AXIS_DRIVER_TYPE_E2(T) AXIS_DRIVER_TYPE(E2,T)
#else
#define AXIS_DRIVER_TYPE_E2(T) false
#endif
#if E_STEPPERS > 3
#define AXIS_DRIVER_TYPE_E3(T) AXIS_DRIVER_TYPE(E3,T)
#else
#define AXIS_DRIVER_TYPE_E3(T) false
#endif
#if E_STEPPERS > 4
#define AXIS_DRIVER_TYPE_E4(T) AXIS_DRIVER_TYPE(E4,T)
#else
#define AXIS_DRIVER_TYPE_E4(T) false
#endif
#define HAS_DRIVER(T) (AXIS_DRIVER_TYPE_X(T) || AXIS_DRIVER_TYPE_X2(T) || \ #define HAS_DRIVER(T) (AXIS_DRIVER_TYPE_X(T) || AXIS_DRIVER_TYPE_X2(T) || \
AXIS_DRIVER_TYPE_Y(T) || AXIS_DRIVER_TYPE_Y2(T) || \ AXIS_DRIVER_TYPE_Y(T) || AXIS_DRIVER_TYPE_Y2(T) || \

2
Marlin/src/inc/MarlinConfigPre.h

@ -29,8 +29,8 @@
#include "../core/types.h" #include "../core/types.h"
#include "Version.h" #include "Version.h"
#include "../../Configuration.h" #include "../../Configuration.h"
#include "../core/drivers.h"
#include "Conditionals_LCD.h" #include "Conditionals_LCD.h"
#include "../core/drivers.h"
#include "../../Configuration_adv.h" #include "../../Configuration_adv.h"
#include "Conditionals_adv.h" #include "Conditionals_adv.h"

Loading…
Cancel
Save