Extended condition macros (#13419)
Allow `ENABLED`, `DISABLED`, `PIN_EXISTS`, and `BUTTON_EXISTS` to take multiple arguments. Also add: - Alias `ANY(...)` for `!DISABLED(...)` - Alias `ANY_PIN(...)` for `PIN_EXISTS(a) || PIN_EXISTS(b) ...` - Alias `EITHER(A,B)` for `ANY(...)` - Alias `ALL(...)` and `BOTH(A,B)` for `ENABLED(...)` - `NONE(...)` for `DISABLED(...)`
This commit is contained in:
@ -199,13 +199,13 @@
|
||||
#endif
|
||||
|
||||
#ifndef FAN_PIN
|
||||
#if ENABLED(IS_RAMPS_EFB) || ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan
|
||||
#if EITHER(IS_RAMPS_EFB, IS_RAMPS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan
|
||||
#define FAN_PIN RAMPS_D9_PIN
|
||||
#elif ENABLED(IS_RAMPS_EEF) || ENABLED(IS_RAMPS_SF) // Hotend, Hotend, Fan or Spindle, Fan
|
||||
#elif EITHER(IS_RAMPS_EEF, IS_RAMPS_SF) // Hotend, Hotend, Fan or Spindle, Fan
|
||||
#define FAN_PIN RAMPS_D8_PIN
|
||||
#elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed
|
||||
#define FAN_PIN 4 // IO pin. Buffer needed
|
||||
#else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
|
||||
#elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed
|
||||
#define FAN_PIN 4 // IO pin. Buffer needed
|
||||
#else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
|
||||
#define FAN_PIN RAMPS_D9_PIN
|
||||
#endif
|
||||
#endif
|
||||
@ -232,8 +232,7 @@
|
||||
#if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENABLE_PIN)
|
||||
#if NUM_SERVOS <= 1 // try to use servo connector first
|
||||
#define CASE_LIGHT_PIN 6 // MUST BE HARDWARE PWM
|
||||
#elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) \
|
||||
&& (ENABLED(PANEL_ONE) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MINIPANEL) || ENABLED(REPRAPWORLD_KEYPAD))) // try to use AUX 2
|
||||
#elif !(BOTH(ULTRA_LCD, NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD)) // try to use AUX 2
|
||||
#define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM
|
||||
#endif
|
||||
#endif
|
||||
@ -246,8 +245,7 @@
|
||||
#define SPINDLE_LASER_ENABLE_PIN 4 // Pin should have a pullup/pulldown!
|
||||
#define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM
|
||||
#define SPINDLE_DIR_PIN 5
|
||||
#elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) \
|
||||
&& (ENABLED(PANEL_ONE) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MINIPANEL) || ENABLED(REPRAPWORLD_KEYPAD))) // try to use AUX 2
|
||||
#elif !(BOTH(ULTRA_LCD, NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD)) // try to use AUX 2
|
||||
#define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup/pulldown!
|
||||
#define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM
|
||||
#define SPINDLE_DIR_PIN 65
|
||||
@ -347,7 +345,7 @@
|
||||
#define LCD_PINS_ENABLE 51 // SID (MOSI)
|
||||
#define LCD_PINS_D4 52 // SCK (CLK) clock
|
||||
|
||||
#elif ENABLED(NEWPANEL) && ENABLED(PANEL_ONE)
|
||||
#elif BOTH(NEWPANEL, PANEL_ONE)
|
||||
|
||||
#define LCD_PINS_RS 40
|
||||
#define LCD_PINS_ENABLE 42
|
||||
@ -379,7 +377,7 @@
|
||||
|
||||
#else
|
||||
|
||||
#if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)
|
||||
#if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
|
||||
#define LCD_PINS_DC 25 // Set as output on init
|
||||
#define LCD_PINS_RS 27 // Pull low for 1s to init
|
||||
// DOGM SPI LCD Support
|
||||
@ -463,7 +461,7 @@
|
||||
#define LCD_SDSS SDSS
|
||||
#define SD_DETECT_PIN 49
|
||||
|
||||
#elif ENABLED(VIKI2) || ENABLED(miniVIKI)
|
||||
#elif ANY(VIKI2, miniVIKI)
|
||||
|
||||
#define DOGLCD_CS 45
|
||||
#define DOGLCD_A0 44
|
||||
|
Reference in New Issue
Block a user