0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-02-17 14:50:58 +00:00

Merge pull request #10120 from thinkyhead/bf1_misc_fixes_mar16

[1.1.x] Reduce size of "only one" sanity checks
This commit is contained in:
Scott Lahteine 2018-03-16 21:43:15 -05:00 committed by GitHub
commit 4dc4d348d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 145 additions and 342 deletions

View file

@ -413,7 +413,7 @@
#else #else
#define E_STEPPERS 1 #define E_STEPPERS 1
#endif #endif
#define E_MANUAL E_STEPPERS #define E_MANUAL EXTRUDERS
#elif ENABLED(MIXING_EXTRUDER) #elif ENABLED(MIXING_EXTRUDER)
#define E_STEPPERS MIXING_STEPPERS #define E_STEPPERS MIXING_STEPPERS
#define E_MANUAL 1 #define E_MANUAL 1

View file

@ -622,36 +622,18 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
/** /**
* Allow only one kinematic type to be defined * Allow only one kinematic type to be defined
*/ */
static_assert(1 >= 0 #if 1 < 0 \
#if ENABLED(DELTA) + ENABLED(DELTA) \
+ 1 + ENABLED(MORGAN_SCARA) \
#endif + ENABLED(MAKERARM_SCARA) \
#if ENABLED(MORGAN_SCARA) + ENABLED(COREXY) \
+ 1 + ENABLED(COREXZ) \
#endif + ENABLED(COREYZ) \
#if ENABLED(MAKERARM_SCARA) + ENABLED(COREYX) \
+ 1 + ENABLED(COREZX) \
#endif + ENABLED(COREZY)
#if ENABLED(COREXY) #error "Please enable only one of DELTA, MORGAN_SCARA, MAKERARM_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY."
+ 1 #endif
#endif
#if ENABLED(COREXZ)
+ 1
#endif
#if ENABLED(COREYZ)
+ 1
#endif
#if ENABLED(COREYX)
+ 1
#endif
#if ENABLED(COREZX)
+ 1
#endif
#if ENABLED(COREZY)
+ 1
#endif
, "Please enable only one of DELTA, MORGAN_SCARA, MAKERARM_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY."
);
/** /**
* Delta requirements * Delta requirements
@ -679,30 +661,16 @@ static_assert(1 >= 0
/** /**
* Allow only one probe option to be defined * Allow only one probe option to be defined
*/ */
static_assert(1 >= 0 #if 1 < 0 \
#if ENABLED(PROBE_MANUALLY) + ENABLED(PROBE_MANUALLY) \
+ 1 + ENABLED(FIX_MOUNTED_PROBE) \
#endif + (HAS_Z_SERVO_ENDSTOP && DISABLED(BLTOUCH)) \
#if ENABLED(FIX_MOUNTED_PROBE) + ENABLED(BLTOUCH) \
+ 1 + ENABLED(SOLENOID_PROBE) \
#endif + ENABLED(Z_PROBE_ALLEN_KEY) \
#if HAS_Z_SERVO_ENDSTOP && DISABLED(BLTOUCH) + ENABLED(Z_PROBE_SLED)
+ 1 #error "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
#endif #endif
#if ENABLED(BLTOUCH)
+ 1
#endif
#if ENABLED(SOLENOID_PROBE)
+ 1
#endif
#if ENABLED(Z_PROBE_ALLEN_KEY)
+ 1
#endif
#if ENABLED(Z_PROBE_SLED)
+ 1
#endif
, "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
);
#if HAS_BED_PROBE #if HAS_BED_PROBE
@ -793,24 +761,14 @@ static_assert(1 >= 0
/** /**
* Allow only one bed leveling option to be defined * Allow only one bed leveling option to be defined
*/ */
static_assert(1 >= 0 #if 1 < 0 \
#if ENABLED(AUTO_BED_LEVELING_LINEAR) + ENABLED(AUTO_BED_LEVELING_LINEAR) \
+ 1 + ENABLED(AUTO_BED_LEVELING_3POINT) \
#endif + ENABLED(AUTO_BED_LEVELING_BILINEAR) \
#if ENABLED(AUTO_BED_LEVELING_3POINT) + ENABLED(AUTO_BED_LEVELING_UBL) \
+ 1 + ENABLED(MESH_BED_LEVELING)
#endif #error "Select only one of: MESH_BED_LEVELING, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) #endif
+ 1
#endif
#if ENABLED(AUTO_BED_LEVELING_UBL)
+ 1
#endif
#if ENABLED(MESH_BED_LEVELING)
+ 1
#endif
, "Select only one of: MESH_BED_LEVELING, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
);
/** /**
* Bed Leveling Requirements * Bed Leveling Requirements
@ -1354,120 +1312,53 @@ static_assert(1 >= 0
* ELB_FULL_GRAPHIC_CONTROLLER => ULTIMAKERCONTROLLER * ELB_FULL_GRAPHIC_CONTROLLER => ULTIMAKERCONTROLLER
* PANEL_ONE => ULTIMAKERCONTROLLER * PANEL_ONE => ULTIMAKERCONTROLLER
*/ */
static_assert(1 >= 0 #if 1 < 0 \
#if ENABLED(ULTIMAKERCONTROLLER) \ + ( ENABLED(ULTIMAKERCONTROLLER) \
&& DISABLED(SAV_3DGLCD) \ && DISABLED(SAV_3DGLCD) \
&& DISABLED(miniVIKI) \ && DISABLED(miniVIKI) \
&& DISABLED(VIKI2) \ && DISABLED(VIKI2) \
&& DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
&& DISABLED(PANEL_ONE) \ && DISABLED(PANEL_ONE) \
&& DISABLED(MKS_12864OLED) \ && DISABLED(MKS_12864OLED) \
&& DISABLED(MKS_12864OLED_SSD1306) && DISABLED(MKS_12864OLED_SSD1306) ) \
+ 1 + ( ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
#endif
#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
&& DISABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \ && DISABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \
&& DISABLED(LCD_FOR_MELZI) \ && DISABLED(LCD_FOR_MELZI) \
&& DISABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \ && DISABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
&& DISABLED(MKS_12864OLED) \ && DISABLED(MKS_12864OLED) \
&& DISABLED(MKS_12864OLED_SSD1306) && DISABLED(MKS_12864OLED_SSD1306) ) \
+ 1 + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(BQ_LCD_SMART_CONTROLLER)) \
#endif + ENABLED(LCD_FOR_MELZI) \
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \ + ENABLED(MKS_12864OLED) \
&& DISABLED(BQ_LCD_SMART_CONTROLLER) + ENABLED(MKS_12864OLED_SSD1306) \
+ 1 + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
#endif + ENABLED(CARTESIO_UI) \
#if ENABLED(LCD_FOR_MELZI) + ENABLED(PANEL_ONE) \
+ 1 + ENABLED(MAKRPANEL) \
#endif + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \
#if ENABLED(MKS_12864OLED) + ENABLED(VIKI2) \
+ 1 + ENABLED(miniVIKI) \
#endif + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
#if ENABLED(MKS_12864OLED_SSD1306) + ENABLED(G3D_PANEL) \
+ 1 + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \
#endif + ENABLED(MKS_MINI_12864) \
#if ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) + (ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(CARTESIO_UI) && DISABLED(ZONESTAR_LCD)) \
+ 1 + ENABLED(RIGIDBOT_PANEL) \
#endif + ENABLED(RA_CONTROL_PANEL) \
#if ENABLED(CARTESIO_UI) + ENABLED(LCD_SAINSMART_I2C_1602) \
+ 1 + ENABLED(LCD_SAINSMART_I2C_2004) \
#endif + ENABLED(LCM1602) \
#if ENABLED(PANEL_ONE) + ENABLED(LCD_I2C_PANELOLU2) \
+ 1 + ENABLED(LCD_I2C_VIKI) \
#endif + (ENABLED(U8GLIB_SSD1306) && DISABLED(OLED_PANEL_TINYBOY2) && DISABLED(MKS_12864OLED_SSD1306)) \
#if ENABLED(MAKRPANEL) + ENABLED(SAV_3DLCD) \
+ 1 + ENABLED(BQ_LCD_SMART_CONTROLLER) \
#endif + ENABLED(SAV_3DGLCD) \
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + ENABLED(OLED_PANEL_TINYBOY2) \
+ 1 + ENABLED(ZONESTAR_LCD) \
#endif + ENABLED(ULTI_CONTROLLER)
#if ENABLED(VIKI2) #error "Please select no more than one LCD controller option."
+ 1 #endif
#endif
#if ENABLED(miniVIKI)
+ 1
#endif
#if ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
+ 1
#endif
#if ENABLED(G3D_PANEL)
+ 1
#endif
#if ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)
+ 1
#endif
#if ENABLED(MKS_MINI_12864)
+ 1
#endif
#if ENABLED(REPRAPWORLD_KEYPAD) \
&& DISABLED(CARTESIO_UI) \
&& DISABLED(ZONESTAR_LCD)
+ 1
#endif
#if ENABLED(RIGIDBOT_PANEL)
+ 1
#endif
#if ENABLED(RA_CONTROL_PANEL)
+ 1
#endif
#if ENABLED(LCD_SAINSMART_I2C_1602)
+ 1
#endif
#if ENABLED(LCD_SAINSMART_I2C_2004)
+ 1
#endif
#if ENABLED(LCM1602)
+ 1
#endif
#if ENABLED(LCD_I2C_PANELOLU2)
+ 1
#endif
#if ENABLED(LCD_I2C_VIKI)
+ 1
#endif
#if ENABLED(U8GLIB_SSD1306) && DISABLED(OLED_PANEL_TINYBOY2) && DISABLED(MKS_12864OLED_SSD1306)
+ 1
#endif
#if ENABLED(SAV_3DLCD)
+ 1
#endif
#if ENABLED(BQ_LCD_SMART_CONTROLLER)
+ 1
#endif
#if ENABLED(SAV_3DGLCD)
+ 1
#endif
#if ENABLED(OLED_PANEL_TINYBOY2)
+ 1
#endif
#if ENABLED(ZONESTAR_LCD)
+ 1
#endif
#if ENABLED(ULTI_CONTROLLER)
+ 1
#endif
, "Please select no more than one LCD controller option."
);
/** /**
* Make sure HAVE_TMC26X is warranted * Make sure HAVE_TMC26X is warranted
@ -1620,171 +1511,83 @@ static_assert(1 >= 0
/** /**
* Check that each axis has only one driver selected * Check that each axis has only one driver selected
*/ */
static_assert(1 >= 0 #if 1 < 0 \
#if ENABLED(X_IS_TMC26X) + ENABLED(X_IS_TMC26X) \
+ 1 + ENABLED(X_IS_TMC2130) \
#endif + ENABLED(X_IS_TMC2208) \
#if ENABLED(X_IS_TMC2130) + ENABLED(X_IS_L6470)
+ 1 #error "Please enable only one stepper driver for the X axis."
#endif #endif
#if ENABLED(X_IS_TMC2208) #if 1 < 0 \
+ 1 + ENABLED(X2_IS_TMC26X) \
#endif + ENABLED(X2_IS_TMC2130) \
#if ENABLED(X_IS_L6470) + ENABLED(X2_IS_TMC2208) \
+ 1 + ENABLED(X2_IS_L6470)
#endif #error "Please enable only one stepper driver for the X2 axis."
, "Please enable only one stepper driver for the X axis." #endif
); #if 1 < 0 \
static_assert(1 >= 0 + ENABLED(Y_IS_TMC26X) \
#if ENABLED(X2_IS_TMC26X) + ENABLED(Y_IS_TMC2130) \
+ 1 + ENABLED(Y_IS_TMC2208) \
#endif + ENABLED(Y_IS_L6470)
#if ENABLED(X2_IS_TMC2130) #error "Please enable only one stepper driver for the Y axis."
+ 1 #endif
#endif #if 1 < 0 \
#if ENABLED(X2_IS_TMC2208) + ENABLED(Y2_IS_TMC26X) \
+ 1 + ENABLED(Y2_IS_TMC2130) \
#endif + ENABLED(Y2_IS_TMC2208) \
#if ENABLED(X2_IS_L6470) + ENABLED(Y2_IS_L6470)
+ 1 #error "Please enable only one stepper driver for the Y2 axis."
#endif #endif
, "Please enable only one stepper driver for the X2 axis." #if 1 < 0 \
); + ENABLED(Z_IS_TMC26X) \
static_assert(1 >= 0 + ENABLED(Z_IS_TMC2130) \
#if ENABLED(Y_IS_TMC26X) + ENABLED(Z_IS_TMC2208) \
+ 1 + ENABLED(Z_IS_L6470)
#endif #error "Please enable only one stepper driver for the Z axis."
#if ENABLED(Y_IS_TMC2130) #endif
+ 1 #if 1 < 0 \
#endif + ENABLED(Z2_IS_TMC26X) \
#if ENABLED(Y_IS_TMC2208) + ENABLED(Z2_IS_TMC2130) \
+ 1 + ENABLED(Z2_IS_TMC2208) \
#endif + ENABLED(Z2_IS_L6470)
#if ENABLED(Y_IS_L6470) #error "Please enable only one stepper driver for the Z2 axis."
+ 1 #endif
#endif #if 1 < 0 \
, "Please enable only one stepper driver for the Y axis." + ENABLED(E0_IS_TMC26X) \
); + ENABLED(E0_IS_TMC2130) \
static_assert(1 >= 0 + ENABLED(E0_IS_TMC2208) \
#if ENABLED(Y2_IS_TMC26X) + ENABLED(E0_IS_L6470)
+ 1 #error "Please enable only one stepper driver for the E0 axis."
#endif #endif
#if ENABLED(Y2_IS_TMC2130) #if 1 < 0 \
+ 1 + ENABLED(E1_IS_TMC26X) \
#endif + ENABLED(E1_IS_TMC2130) \
#if ENABLED(Y2_IS_TMC2208) + ENABLED(E1_IS_TMC2208) \
+ 1 + ENABLED(E1_IS_L6470)
#endif #error "Please enable only one stepper driver for the E1 axis."
#if ENABLED(Y2_IS_L6470) #endif
+ 1 #if 1 < 0 \
#endif + ENABLED(E2_IS_TMC26X) \
, "Please enable only one stepper driver for the Y2 axis." + ENABLED(E2_IS_TMC2130) \
); + ENABLED(E2_IS_TMC2208) \
static_assert(1 >= 0 + ENABLED(E2_IS_L6470)
#if ENABLED(Z_IS_TMC26X) #error "Please enable only one stepper driver for the E2 axis."
+ 1 #endif
#endif #if 1 < 0 \
#if ENABLED(Z_IS_TMC2130) + ENABLED(E3_IS_TMC26X) \
+ 1 + ENABLED(E3_IS_TMC2130) \
#endif + ENABLED(E3_IS_TMC2208) \
#if ENABLED(Z_IS_TMC2208) + ENABLED(E3_IS_L6470)
+ 1 #error "Please enable only one stepper driver for the E3 axis."
#endif #endif
#if ENABLED(Z_IS_L6470) #if 1 < 0 \
+ 1 + ENABLED(E4_IS_TMC26X) \
#endif + ENABLED(E4_IS_TMC2130) \
, "Please enable only one stepper driver for the Z axis." + ENABLED(E4_IS_TMC2208) \
); + ENABLED(E4_IS_L6470)
static_assert(1 >= 0 #error "Please enable only one stepper driver for the E4 axis."
#if ENABLED(Z2_IS_TMC26X) #endif
+ 1
#endif
#if ENABLED(Z2_IS_TMC2130)
+ 1
#endif
#if ENABLED(Z2_IS_TMC2208)
+ 1
#endif
#if ENABLED(Z2_IS_L6470)
+ 1
#endif
, "Please enable only one stepper driver for the Z2 axis."
);
static_assert(1 >= 0
#if ENABLED(E0_IS_TMC26X)
+ 1
#endif
#if ENABLED(E0_IS_TMC2130)
+ 1
#endif
#if ENABLED(E0_IS_TMC2208)
+ 1
#endif
#if ENABLED(E0_IS_L6470)
+ 1
#endif
, "Please enable only one stepper driver for the E0 axis."
);
static_assert(1 >= 0
#if ENABLED(E1_IS_TMC26X)
+ 1
#endif
#if ENABLED(E1_IS_TMC2130)
+ 1
#endif
#if ENABLED(E1_IS_TMC2208)
+ 1
#endif
#if ENABLED(E1_IS_L6470)
+ 1
#endif
, "Please enable only one stepper driver for the E1 axis."
);
static_assert(1 >= 0
#if ENABLED(E2_IS_TMC26X)
+ 1
#endif
#if ENABLED(E2_IS_TMC2130)
+ 1
#endif
#if ENABLED(E2_IS_TMC2208)
+ 1
#endif
#if ENABLED(E2_IS_L6470)
+ 1
#endif
, "Please enable only one stepper driver for the E2 axis."
);
static_assert(1 >= 0
#if ENABLED(E3_IS_TMC26X)
+ 1
#endif
#if ENABLED(E3_IS_TMC2130)
+ 1
#endif
#if ENABLED(E3_IS_TMC2208)
+ 1
#endif
#if ENABLED(E3_IS_L6470)
+ 1
#endif
, "Please enable only one stepper driver for the E3 axis."
);
static_assert(1 >= 0
#if ENABLED(E4_IS_TMC26X)
+ 1
#endif
#if ENABLED(E4_IS_TMC2130)
+ 1
#endif
#if ENABLED(E4_IS_TMC2208)
+ 1
#endif
#if ENABLED(E4_IS_L6470)
+ 1
#endif
, "Please enable only one stepper driver for the E4 axis."
);
/** /**
* Digipot requirement * Digipot requirement