Browse Source

Reduce size of "only one" sanity checks

pull/1/head
Scott Lahteine 7 years ago
parent
commit
5f77816772
  1. 507
      Marlin/src/inc/SanityCheck.h

507
Marlin/src/inc/SanityCheck.h

@ -649,36 +649,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
@ -706,30 +688,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
@ -820,24 +788,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
@ -1382,8 +1340,8 @@ static_assert(1 >= 0
* AZSMZ_12864 => ULTIMAKERCONTROLLER * AZSMZ_12864 => 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) \
@ -1391,115 +1349,46 @@ static_assert(1 >= 0
&& DISABLED(AZSMZ_12864) \ && DISABLED(AZSMZ_12864) \
&& 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(AZSMZ_12864) \
+ 1 + ENABLED(G3D_PANEL) \
#endif + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \
#if ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) + ENABLED(MKS_MINI_12864) \
+ 1 + (ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(CARTESIO_UI) && DISABLED(ZONESTAR_LCD)) \
#endif + ENABLED(RIGIDBOT_PANEL) \
#if ENABLED(CARTESIO_UI) + ENABLED(RA_CONTROL_PANEL) \
+ 1 + ENABLED(LCD_SAINSMART_I2C_1602) \
#endif + ENABLED(LCD_SAINSMART_I2C_2004) \
#if ENABLED(PANEL_ONE) + ENABLED(LCM1602) \
+ 1 + ENABLED(LCD_I2C_PANELOLU2) \
#endif + ENABLED(LCD_I2C_VIKI) \
#if ENABLED(MAKRPANEL) + (ENABLED(U8GLIB_SSD1306) && DISABLED(OLED_PANEL_TINYBOY2) && DISABLED(MKS_12864OLED_SSD1306)) \
+ 1 + ENABLED(SAV_3DLCD) \
#endif + ENABLED(BQ_LCD_SMART_CONTROLLER) \
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + ENABLED(SAV_3DGLCD) \
+ 1 + ENABLED(OLED_PANEL_TINYBOY2) \
#endif + ENABLED(ZONESTAR_LCD) \
#if ENABLED(VIKI2) + ENABLED(ULTI_CONTROLLER)
+ 1 #error "Please select no more than one LCD controller option."
#endif #endif
#if ENABLED(miniVIKI)
+ 1
#endif
#if ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
+ 1
#endif
#if ENABLED(AZSMZ_12864)
+ 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
@ -1604,6 +1493,24 @@ static_assert(1 >= 0
#error "HAVE_TMC2208 requires at least one TMC2208 stepper to be set." #error "HAVE_TMC2208 requires at least one TMC2208 stepper to be set."
#endif #endif
/**
* TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI)
*/
#if ENABLED(HAVE_TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \
defined(X_HARDWARE_SERIAL ) \
|| defined(X2_HARDWARE_SERIAL) \
|| defined(Y_HARDWARE_SERIAL ) \
|| defined(Y2_HARDWARE_SERIAL) \
|| defined(Z_HARDWARE_SERIAL ) \
|| defined(Z2_HARDWARE_SERIAL) \
|| defined(E0_HARDWARE_SERIAL) \
|| defined(E1_HARDWARE_SERIAL) \
|| defined(E2_HARDWARE_SERIAL) \
|| defined(E3_HARDWARE_SERIAL) \
|| defined(E4_HARDWARE_SERIAL) )
#error "select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE."
#endif
#if ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP) #if ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP)
#error "Enable STEALTHCHOP to use HYBRID_THRESHOLD." #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD."
#endif #endif
@ -1634,171 +1541,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

Loading…
Cancel
Save