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:
Scott Lahteine 2019-03-16 23:43:06 -05:00 committed by GitHub
parent d20eab4f83
commit 49cf92dc36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
281 changed files with 1299 additions and 1288 deletions

View File

@ -218,7 +218,7 @@
*/
//#define MAGNETIC_PARKING_EXTRUDER
#if ENABLED(PARKING_EXTRUDER) || ENABLED(MAGNETIC_PARKING_EXTRUDER)
#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER)
#define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders
#define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder
@ -1015,7 +1015,7 @@
#define MAX_SOFTWARE_ENDSTOP_Z
#endif
#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS)
#if EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
//#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD
#endif
@ -1108,7 +1108,7 @@
*/
//#define DEBUG_LEVELING_FEATURE
#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL)
#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL)
// Gradually reduce leveling correction until a set height is reached,
// at which point movement will be level to the machine's XY plane.
// The height can be set with M420 Z<height>
@ -1134,7 +1134,7 @@
#endif
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension.
#define GRID_MAX_POINTS_X 3
@ -1203,7 +1203,7 @@
* Points to probe for all 3-point Leveling procedures.
* Override if the automatically selected points are inadequate.
*/
#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL)
#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL)
//#define PROBE_PT_1_X 15
//#define PROBE_PT_1_Y 180
//#define PROBE_PT_2_X 15
@ -2037,7 +2037,7 @@
//#define RGB_LED
//#define RGBW_LED
#if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
#if EITHER(RGB_LED, RGBW_LED)
#define RGB_LED_R_PIN 34
#define RGB_LED_G_PIN 43
#define RGB_LED_B_PIN 35
@ -2066,7 +2066,7 @@
* - Change to green once print has finished
* - Turn off after the print has finished and the user has pushed a button
*/
#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(PCA9533)|| ENABLED(NEOPIXEL_LED)
#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED)
#define PRINTER_EVENT_LEDS
#endif

View File

@ -78,7 +78,7 @@
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
//#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops
#if ENABLED(ADAPTIVE_FAN_SLOWING) && ENABLED(PIDTEMP)
#if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP)
//#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303
#endif
@ -1035,7 +1035,7 @@
// @section leveling
#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL)
#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
// Override the mesh area if the automatic (max) area is too large
//#define MESH_MIN_X MESH_INSET
//#define MESH_MIN_Y MESH_INSET
@ -1654,7 +1654,7 @@
*/
//#define SENSORLESS_PROBING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING) || ENABLED(SENSORLESS_PROBING)
#if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING)
#define X_STALL_SENSITIVITY 8
#define Y_STALL_SENSITIVITY 8
//#define Z_STALL_SENSITIVITY 8

View File

@ -182,7 +182,7 @@ FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t freque
#define TIMER_OCR_0 OCR0A
#define TIMER_COUNTER_0 TCNT0
#define _CAT(a, ...) a ## __VA_ARGS__
#define _CAT(a,V...) a##V
#define HAL_timer_set_compare(timer, compare) (_CAT(TIMER_OCR_, timer) = compare)
#define HAL_timer_get_compare(timer) _CAT(TIMER_OCR_, timer)
#define HAL_timer_get_count(timer) _CAT(TIMER_COUNTER_, timer)

View File

@ -286,7 +286,7 @@ enum ClockSource2 : char {
#define PWM_CHK_FAN_B(P) (P == E0_AUTO_FAN_PIN || P == E1_AUTO_FAN_PIN || P == E2_AUTO_FAN_PIN || P == E3_AUTO_FAN_PIN || P == E4_AUTO_FAN_PIN || P == E5_AUTO_FAN_PIN || P == CHAMBER_AUTO_FAN_PIN)
#endif
#if PIN_EXISTS(FAN) || PIN_EXISTS(FAN1) || PIN_EXISTS(FAN2)
#if ANY_PIN(FAN, FAN1, FAN2)
#if PIN_EXISTS(FAN2)
#define PWM_CHK_FAN_A(P) (P == FAN_PIN || P == FAN1_PIN || P == FAN2_PIN)
#elif PIN_EXISTS(FAN1)

View File

@ -23,7 +23,7 @@
#include "../../inc/MarlinConfig.h"
#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE)
#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
#include "../shared/persistent_store_api.h"

View File

@ -36,7 +36,7 @@
#include <Arduino.h>
#undef DISABLED
#define DISABLED(b) (!_CAT(SWITCH_ENABLED_, b))
#define DISABLED(V...) DO(DIS,&&,V)
#include "../shared/math_32bit.h"
#include "../shared/HAL_SPI.h"

View File

@ -23,7 +23,7 @@
#include "src/core/macros.h"
#if ENABLED(SDSUPPORT) && ENABLED(DOGLCD) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
#if BOTH(SDSUPPORT, DOGLCD) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
#define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode requred for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use

View File

@ -98,7 +98,7 @@ void HAL_init() {
// HAL idle task
void HAL_idletask(void) {
#if ENABLED(SDSUPPORT) && ENABLED(SHARED_SD_CARD)
#if BOTH(SDSUPPORT, SHARED_SD_CARD)
// If Marlin is using the SD card we need to lock it to prevent access from
// a PC via USB.
// Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but

View File

@ -55,7 +55,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
uint8_t v = *value;
// Save to either external EEPROM, program flash or Backup SRAM
#if ENABLED(SPI_EEPROM) || ENABLED(I2C_EEPROM)
#if EITHER(SPI_EEPROM, I2C_EEPROM)
// EEPROM has only ~100,000 write cycles,
// so only write bytes that have changed!
uint8_t * const p = (uint8_t * const)pos;
@ -87,7 +87,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
do {
// Read from either external EEPROM, program flash or Backup SRAM
const uint8_t c = (
#if ENABLED(SPI_EEPROM) || ENABLED(I2C_EEPROM)
#if EITHER(SPI_EEPROM, I2C_EEPROM)
eeprom_read_byte((uint8_t*)pos)
#elif DISABLED(EEPROM_EMULATED_WITH_SRAM)
eeprom_buffered_read_byte(pos)
@ -105,7 +105,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
}
size_t PersistentStore::capacity() {
#if ENABLED(SPI_EEPROM) || ENABLED(I2C_EEPROM)
#if EITHER(SPI_EEPROM, I2C_EEPROM)
return E2END + 1;
#elif DISABLED(EEPROM_EMULATED_WITH_SRAM)
return E2END + 1;

View File

@ -32,7 +32,7 @@
#include "../../inc/MarlinConfig.h"
// This is for EEPROM emulation in flash
#if ENABLED(EEPROM_SETTINGS) && ENABLED(FLASH_EEPROM_EMULATION)
#if BOTH(EEPROM_SETTINGS, FLASH_EEPROM_EMULATION)
#include "../shared/persistent_store_api.h"

View File

@ -22,7 +22,7 @@
*/
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE)
#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
#include "persistent_store_api.h"
PersistentStore persistentStore;

View File

@ -128,7 +128,7 @@
#include "feature/bedlevel/bedlevel.h"
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE) && ENABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
#if BOTH(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_NO_STEPPER_TIMEOUT)
#include "feature/pause.h"
#endif
@ -152,7 +152,7 @@
#include "feature/fanmux.h"
#endif
#if DO_SWITCH_EXTRUDER || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER) || ENABLED(MAGNETIC_PARKING_EXTRUDER)
#if DO_SWITCH_EXTRUDER || ANY(SWITCHING_NOZZLE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER)
#include "module/tool_change.h"
#endif
@ -328,7 +328,7 @@ void disable_all_steppers() {
ExtUI::onFilamentRunout(ExtUI::getActiveTool());
#endif
#if ENABLED(HOST_PROMPT_SUPPORT) || ENABLED(HOST_ACTION_COMMANDS)
#if EITHER(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS)
const char tool = '0'
#if NUM_RUNOUT_SENSORS > 1
+ active_extruder
@ -443,7 +443,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
}
// Prevent steppers timing-out in the middle of M600
#if ENABLED(ADVANCED_PAUSE_FEATURE) && ENABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
#if BOTH(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_NO_STEPPER_TIMEOUT)
#define MOVE_AWAY_TEST !did_pause_print
#else
#define MOVE_AWAY_TEST true
@ -1000,7 +1000,7 @@ void setup() {
dac_init();
#endif
#if (ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE)) && HAS_SOLENOID_1
#if EITHER(Z_PROBE_SLED, SOLENOID_PROBE) && HAS_SOLENOID_1
OUT_WRITE(SOL1_PIN, LOW); // OFF
#endif

View File

@ -52,7 +52,7 @@
#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_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))
#define AXIS_DRIVER_TYPE_X2(T) (EITHER(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE) && _AXIS_DRIVER_TYPE(X2,T))
#define AXIS_DRIVER_TYPE_Y2(T) (ENABLED(Y_DUAL_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Y2,T))
#define AXIS_DRIVER_TYPE_Z2(T) (Z_MULTI_STEPPER_DRIVERS && _AXIS_DRIVER_TYPE(Z2,T))
#define AXIS_DRIVER_TYPE_Z3(T) (ENABLED(Z_TRIPLE_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Z3,T))

View File

@ -133,8 +133,25 @@
#endif
// Macros to chain up to 12 conditions
#define _DO_1(W,C,A) (_##W##_1(A))
#define _DO_2(W,C,A,B) (_##W##_1(A) C _##W##_1(B))
#define _DO_3(W,C,A,V...) (_##W##_1(A) C _DO_2(W,C,V))
#define _DO_4(W,C,A,V...) (_##W##_1(A) C _DO_3(W,C,V))
#define _DO_5(W,C,A,V...) (_##W##_1(A) C _DO_4(W,C,V))
#define _DO_6(W,C,A,V...) (_##W##_1(A) C _DO_5(W,C,V))
#define _DO_7(W,C,A,V...) (_##W##_1(A) C _DO_6(W,C,V))
#define _DO_8(W,C,A,V...) (_##W##_1(A) C _DO_7(W,C,V))
#define _DO_9(W,C,A,V...) (_##W##_1(A) C _DO_8(W,C,V))
#define _DO_10(W,C,A,V...) (_##W##_1(A) C _DO_9(W,C,V))
#define _DO_11(W,C,A,V...) (_##W##_1(A) C _DO_10(W,C,V))
#define _DO_12(W,C,A,V...) (_##W##_1(A) C _DO_11(W,C,V))
#define __DO_N(W,C,N,V...) _DO_##N(W,C,V)
#define _DO_N(W,C,N,V...) __DO_N(W,C,N,V)
#define DO(W,C,V...) _DO_N(W,C,NUM_ARGS(V),V)
// Macros to support option testing
#define _CAT(a, ...) a ## __VA_ARGS__
#define _CAT(a,V...) a##V
#define SWITCH_ENABLED_false 0
#define SWITCH_ENABLED_true 1
#define SWITCH_ENABLED_0 0
@ -142,10 +159,27 @@
#define SWITCH_ENABLED_0x0 0
#define SWITCH_ENABLED_0x1 1
#define SWITCH_ENABLED_ 1
#define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
#define DISABLED(b) !ENABLED(b)
#define _ENA_1(O) _CAT(SWITCH_ENABLED_, O)
#define _DIS_1(O) !_ENA_1(O)
#define ENABLED(V...) DO(ENA,&&,V)
#define DISABLED(V...) DO(DIS,&&,V)
#define WITHIN(V,L,H) ((V) >= (L) && (V) <= (H))
#define ANY(V...) !DISABLED(V)
#define NONE(V...) DISABLED(V)
#define ALL(V...) ENABLED(V)
#define BOTH(V1,V2) ALL(V1,V2)
#define EITHER(V1,V2) ANY(V1,V2)
// Macros to support pins/buttons exist testing
#define _PINEX_1(PN) (defined(PN##_PIN) && PN##_PIN >= 0)
#define PIN_EXISTS(V...) DO(PINEX,&&,V)
#define ANY_PIN(V...) DO(PINEX,||,V)
#define _BTNEX_1(BN) (defined(BTN_##BN) && BTN_##BN >= 0)
#define BUTTON_EXISTS(V...) DO(BTNEX,&&,V)
#define ANY_BUTTON(V...) DO(BTNEX,||,V)
#define WITHIN(N,L,H) ((N) >= (L) && (N) <= (H))
#define NUMERIC(a) WITHIN(a, '0', '9')
#define DECIMAL(a) (NUMERIC(a) || a == '.')
#define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-' || (a) == '+')
@ -165,8 +199,8 @@
#define ARRAY_2(v1, v2, ...) { v1, v2 }
#define ARRAY_1(v1, ...) { v1 }
#define _ARRAY_N(N, ...) ARRAY_ ##N(__VA_ARGS__)
#define ARRAY_N(N, ...) _ARRAY_N(N, __VA_ARGS__)
#define _ARRAY_N(N,V...) ARRAY_##N(V)
#define ARRAY_N(N,V...) _ARRAY_N(N,V)
// Macros for adding
#define INC_0 1
@ -194,9 +228,6 @@
#define DECREMENT_(n) DEC_##n
#define DECREMENT(n) DECREMENT_(n)
#define PIN_EXISTS(PN) (defined(PN ##_PIN) && PN ##_PIN >= 0)
#define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0)
#define MMM_TO_MMS(MM_M) ((MM_M)/60.0f)
#define MMS_TO_MMM(MM_S) ((MM_S)*60.0f)

View File

@ -23,9 +23,9 @@
#undef MIN
#undef MAX
// Pass NUM_ARGS(__VA_ARGS__) to use the number of arguments
// Use NUM_ARGS(__VA_ARGS__) to get the number of variadic arguments
#define _NUM_ARGS(_0,_24_,_23,_22,_21,_20,_19,_18,_17,_16,_15,_14,_13,_12,_11,_10,_9,_8,_7,_6,_5,_4,_3,_2,_1,N,...) N
#define NUM_ARGS(...) _NUM_ARGS(0, __VA_ARGS__ ,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
#define NUM_ARGS(V...) _NUM_ARGS(0,V,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
#ifdef __cplusplus

View File

@ -35,7 +35,7 @@ void safe_delay(millis_t ms) {
thermalManager.manage_heater(); // This keeps us safe if too many small safe_delay() calls are made
}
#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE)
#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
void crc16(uint16_t *crc, const void * const data, uint16_t cnt) {
uint8_t *ptr = (uint8_t *)data;
@ -48,7 +48,7 @@ void safe_delay(millis_t ms) {
#endif // EEPROM_SETTINGS || SD_FIRMWARE_UPDATE
#if ENABLED(ULTRA_LCD) || ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(EXTENSIBLE_UI)
#if ANY(ULTRA_LCD, DEBUG_LEVELING_FEATURE, EXTENSIBLE_UI)
char conv[8] = { 0 };

View File

@ -37,11 +37,11 @@ inline void serial_delay(const millis_t ms) {
#endif
}
#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE)
#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
void crc16(uint16_t *crc, const void * const data, uint16_t cnt);
#endif
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)
#if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)
/**
* These support functions allow the use of large bit arrays of flags that take very
* little RAM. Currently they are limited to being 16x16 in size. Changing the declaration
@ -53,7 +53,7 @@ inline void serial_delay(const millis_t ms) {
FORCE_INLINE bool is_bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { return TEST(bits[y], x); }
#endif
#if ENABLED(ULTRA_LCD) || ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(EXTENSIBLE_UI)
#if ANY(ULTRA_LCD, DEBUG_LEVELING_FEATURE, EXTENSIBLE_UI)
// Convert uint8_t to string with 123 format
char* ui8tostr3(const uint8_t x);

View File

@ -27,7 +27,7 @@
#include "bedlevel.h"
#include "../../module/planner.h"
#if ENABLED(MESH_BED_LEVELING) || ENABLED(PROBE_MANUALLY)
#if EITHER(MESH_BED_LEVELING, PROBE_MANUALLY)
#include "../../module/motion.h"
#endif
@ -146,7 +146,7 @@ void reset_bed_level() {
#endif
}
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(MESH_BED_LEVELING)
#if EITHER(AUTO_BED_LEVELING_BILINEAR, MESH_BED_LEVELING)
/**
* Enable to produce output in JSON format suitable
@ -215,7 +215,7 @@ void reset_bed_level() {
#endif // AUTO_BED_LEVELING_BILINEAR || MESH_BED_LEVELING
#if ENABLED(MESH_BED_LEVELING) || ENABLED(PROBE_MANUALLY)
#if EITHER(MESH_BED_LEVELING, PROBE_MANUALLY)
void _manual_goto_xy(const float &rx, const float &ry) {

View File

@ -48,7 +48,7 @@ void reset_bed_level();
void set_z_fade_height(const float zfh, const bool do_report=true);
#endif
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(MESH_BED_LEVELING)
#if EITHER(AUTO_BED_LEVELING_BILINEAR, MESH_BED_LEVELING)
#include <stdint.h>
@ -61,7 +61,7 @@ void reset_bed_level();
#endif
#if ENABLED(MESH_BED_LEVELING) || ENABLED(PROBE_MANUALLY)
#if EITHER(MESH_BED_LEVELING, PROBE_MANUALLY)
void _manual_goto_xy(const float &x, const float &y);
#endif

View File

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h"
#if ENABLED(DIGIPOT_I2C) && ENABLED(DIGIPOT_MCP4018)
#if BOTH(DIGIPOT_I2C, DIGIPOT_MCP4018)
#include "../../core/enum.h"
#include "Stream.h"

View File

@ -52,7 +52,7 @@
);
#endif
#if ENABLED(LED_CONTROL_MENU) || ENABLED(PRINTER_EVENT_LEDS)
#if EITHER(LED_CONTROL_MENU, PRINTER_EVENT_LEDS)
LEDColor LEDLights::color;
bool LEDLights::lights_on;
#endif
@ -60,7 +60,7 @@
LEDLights leds;
void LEDLights::setup() {
#if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
#if EITHER(RGB_LED, RGBW_LED)
if (PWM_PIN(RGB_LED_R_PIN)) SET_PWM(RGB_LED_R_PIN); else SET_OUTPUT(RGB_LED_R_PIN);
if (PWM_PIN(RGB_LED_G_PIN)) SET_PWM(RGB_LED_G_PIN); else SET_OUTPUT(RGB_LED_G_PIN);
if (PWM_PIN(RGB_LED_B_PIN)) SET_PWM(RGB_LED_B_PIN); else SET_OUTPUT(RGB_LED_B_PIN);
@ -108,7 +108,7 @@ void LEDLights::set_color(const LEDColor &incol
#endif
#if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
#if EITHER(RGB_LED, RGBW_LED)
// This variant uses 3-4 separate pins for the RGB(W) components.
// If the pins can do PWM then their intensity will be set.
@ -131,7 +131,7 @@ void LEDLights::set_color(const LEDColor &incol
RGBsetColor(incol.r, incol.g, incol.b, true);
#endif
#if ENABLED(LED_CONTROL_MENU) || ENABLED(PRINTER_EVENT_LEDS)
#if EITHER(LED_CONTROL_MENU, PRINTER_EVENT_LEDS)
// Don't update the color when OFF
lights_on = !incol.is_off();
if (lights_on) color = incol;

View File

@ -33,7 +33,7 @@
#include "neopixel.h"
#endif
#define HAS_WHITE_LED (ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED))
#define HAS_WHITE_LED EITHER(RGBW_LED, NEOPIXEL_LED)
/**
* LEDcolor type for use with leds.set_color
@ -183,7 +183,7 @@ public:
static inline LEDColor get_color() { return lights_on ? color : LEDColorOff(); }
#endif
#if ENABLED(LED_CONTROL_MENU) || ENABLED(PRINTER_EVENT_LEDS)
#if EITHER(LED_CONTROL_MENU, PRINTER_EVENT_LEDS)
static LEDColor color; // last non-off color
static bool lights_on; // the last set color was "on"
#endif

View File

@ -46,7 +46,7 @@ bool Power::is_power_needed() {
HOTEND_LOOP() if (thermalManager.autofan_speed[e]) return true;
#endif
#if ENABLED(AUTO_POWER_CONTROLLERFAN) && HAS_CONTROLLER_FAN && ENABLED(USE_CONTROLLER_FAN)
#if ENABLED(AUTO_POWER_CONTROLLERFAN, USE_CONTROLLER_FAN) && HAS_CONTROLLER_FAN
if (controllerfan_speed) return true;
#endif

View File

@ -22,7 +22,7 @@
#include "../inc/MarlinConfig.h"
#if ENABLED(EXT_SOLENOID) || ENABLED(MANUAL_SOLENOID_CONTROL)
#if EITHER(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL)
#include "solenoid.h"
@ -95,4 +95,4 @@ void disable_all_solenoids() {
#endif
}
#endif // EXT_SOLENOID
#endif // EXT_SOLENOID || MANUAL_SOLENOID_CONTROL

View File

@ -36,7 +36,7 @@
#include "../../../module/probe.h"
#include "../../queue.h"
#if ENABLED(LCD_BED_LEVELING) && ENABLED(PROBE_MANUALLY)
#if BOTH(LCD_BED_LEVELING, PROBE_MANUALLY)
#include "../../../lcd/ultralcd.h"
#endif
@ -151,7 +151,7 @@
*/
G29_TYPE GcodeSuite::G29() {
#if ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(PROBE_MANUALLY)
#if EITHER(DEBUG_LEVELING_FEATURE, PROBE_MANUALLY)
const bool seenQ = parser.seen('Q');
#else
constexpr bool seenQ = false;
@ -205,7 +205,7 @@ G29_TYPE GcodeSuite::G29() {
ABL_VAR float xProbe, yProbe, measured_z;
ABL_VAR bool dryrun, abl_should_enable;
#if ENABLED(PROBE_MANUALLY) || ENABLED(AUTO_BED_LEVELING_LINEAR)
#if EITHER(PROBE_MANUALLY, AUTO_BED_LEVELING_LINEAR)
ABL_VAR int abl_probe_index;
#endif
@ -280,7 +280,7 @@ G29_TYPE GcodeSuite::G29() {
if (active_extruder != 0) tool_change(0);
#endif
#if ENABLED(PROBE_MANUALLY) || ENABLED(AUTO_BED_LEVELING_LINEAR)
#if EITHER(PROBE_MANUALLY, AUTO_BED_LEVELING_LINEAR)
abl_probe_index = -1;
#endif
@ -522,7 +522,7 @@ G29_TYPE GcodeSuite::G29() {
}
else {
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT)
#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT)
const uint16_t index = abl_probe_index - 1;
#endif

View File

@ -400,7 +400,7 @@ void GcodeSuite::G28(const bool always_home_all) {
endstops.not_homing();
#if ENABLED(DELTA) && ENABLED(DELTA_HOME_TO_SAFE_ZONE)
#if BOTH(DELTA, DELTA_HOME_TO_SAFE_ZONE)
// move to a height where we can use the full xy-area
do_blocking_move_to_z(delta_clip_start_height);
#endif

View File

@ -52,8 +52,8 @@
#define CALIBRATION_MEASUREMENT_CERTAIN 0.5 // mm
#endif
#define HAS_X_CENTER (ENABLED(CALIBRATION_MEASURE_LEFT) && ENABLED(CALIBRATION_MEASURE_RIGHT))
#define HAS_Y_CENTER (ENABLED(CALIBRATION_MEASURE_FRONT) && ENABLED(CALIBRATION_MEASURE_BACK))
#define HAS_X_CENTER BOTH(CALIBRATION_MEASURE_LEFT, CALIBRATION_MEASURE_RIGHT)
#define HAS_Y_CENTER BOTH(CALIBRATION_MEASURE_FRONT, CALIBRATION_MEASURE_BACK)
#if ENABLED(BACKLASH_GCODE)
extern float backlash_distance_mm[], backlash_correction, backlash_smoothing_mm;

View File

@ -25,7 +25,7 @@
#include "../../lcd/ultralcd.h"
#include "../../module/stepper.h"
#if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD)
#if BOTH(AUTO_BED_LEVELING_UBL, ULTRA_LCD)
#include "../../feature/bedlevel/bedlevel.h"
#endif

View File

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h"
#if ENABLED(EXT_SOLENOID) || ENABLED(MANUAL_SOLENOID_CONTROL)
#if EITHER(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL)
#include "../gcode.h"
#include "../../feature/solenoid.h"

View File

@ -22,7 +22,7 @@
#include "../../../inc/MarlinConfig.h"
#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || ENABLED(DIGIPOT_I2C) || ENABLED(DAC_STEPPER_CURRENT)
#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || EITHER(DIGIPOT_I2C, DAC_STEPPER_CURRENT)
#include "../../gcode.h"
@ -50,7 +50,7 @@ void GcodeSuite::M907() {
#elif HAS_MOTOR_CURRENT_PWM
#if PIN_EXISTS(MOTOR_CURRENT_PWM_X) || PIN_EXISTS(MOTOR_CURRENT_PWM_Y) || PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
#if ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY)
if (parser.seenval('X') || parser.seenval('Y')) stepper.digipot_current(0, parser.value_int());
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)

View File

@ -117,7 +117,7 @@ void GcodeSuite::get_destination_from_command() {
#endif
// Get ABCDHI mixing factors
#if ENABLED(MIXING_EXTRUDER) && ENABLED(DIRECT_MIXING_IN_G1)
#if BOTH(MIXING_EXTRUDER, DIRECT_MIXING_IN_G1)
M165();
#endif
}
@ -330,7 +330,7 @@ void GcodeSuite::process_parsed_command(
case 33: M33(); break; // M33: Get the long full path to a file or folder
#endif
#if ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_GCODE)
#if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE)
case 34: M34(); break; // M34: Set SD card sorting options
#endif
@ -494,7 +494,7 @@ void GcodeSuite::process_parsed_command(
case 665: M665(); break; // M665: Set delta configurations
#endif
#if ENABLED(DELTA) || ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
#if ANY(DELTA, X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS, Z_DUAL_ENDSTOPS)
case 666: M666(); break; // M666: Set delta or dual endstop adjustment
#endif
@ -576,7 +576,7 @@ void GcodeSuite::process_parsed_command(
case 364: if (M364()) return; break; // M364: SCARA Psi pos3 (90 deg to Theta)
#endif
#if ENABLED(EXT_SOLENOID) || ENABLED(MANUAL_SOLENOID_CONTROL)
#if EITHER(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL)
case 380: M380(); break; // M380: Activate solenoid on active (or specified) extruder
case 381: M381(); break; // M381: Disable all solenoids or, if MANUAL_SOLENOID_CONTROL, active (or specified) solenoid
#endif
@ -673,7 +673,7 @@ void GcodeSuite::process_parsed_command(
case 900: M900(); break; // M900: Set advance K factor.
#endif
#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || ENABLED(DIGIPOT_I2C) || ENABLED(DAC_STEPPER_CURRENT)
#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || EITHER(DIGIPOT_I2C, DAC_STEPPER_CURRENT)
case 907: M907(); break; // M907: Set digital trimpot motor current using axis codes.
#if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT)
case 908: M908(); break; // M908: Control digital trimpot directly.

View File

@ -144,7 +144,7 @@
* M140 - Set bed target temp. S<temp>
* M145 - Set heatup values for materials on the LCD. H<hotend> B<bed> F<fan speed> for S<material> (0=PLA, 1=ABS)
* M149 - Set temperature units. (Requires TEMPERATURE_UNITS_SUPPORT)
* M150 - Set Status LED Color as R<red> U<green> B<blue> P<bright>. Values 0-255. (Requires BLINKM, RGB_LED, RGBW_LED, NEOPIXEL_LED, or PCA9632).
* M150 - Set Status LED Color as R<red> U<green> B<blue> P<bright>. Values 0-255. (Requires BLINKM, RGB_LED, RGBW_LED, NEOPIXEL_LED, PCA9533, or PCA9632).
* M155 - Auto-report temperatures with interval of S<seconds>. (Requires AUTO_REPORT_TEMPERATURES)
* M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER)
* M164 - Commit the mix and save to a virtual tool (current, or as specified by 'S'). (Requires MIXING_EXTRUDER)
@ -480,7 +480,7 @@ private:
#if ENABLED(LONG_FILENAME_HOST_SUPPORT)
static void M33();
#endif
#if ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_GCODE)
#if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE)
static void M34();
#endif
#endif
@ -706,7 +706,7 @@ private:
static bool M364();
#endif
#if ENABLED(EXT_SOLENOID) || ENABLED(MANUAL_SOLENOID_CONTROL)
#if EITHER(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL)
static void M380();
static void M381();
#endif
@ -845,7 +845,7 @@ private:
static void M918();
#endif
#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || ENABLED(DIGIPOT_I2C) || ENABLED(DAC_STEPPER_CURRENT)
#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || EITHER(DIGIPOT_I2C, DAC_STEPPER_CURRENT)
static void M907();
#if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT)
static void M908();

View File

@ -152,7 +152,7 @@ void GcodeSuite::M115() {
// THERMAL_PROTECTION
cap_line(PSTR("THERMAL_PROTECTION")
#if ENABLED(THERMAL_PROTECTION_HOTENDS) && ENABLED(THERMAL_PROTECTION_BED)
#if BOTH(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_BED)
, true
#endif
);

View File

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h"
#if ENABLED(LCD_SET_PROGRESS_MANUALLY) && (ENABLED(EXTENSIBLE_UI) || ENABLED(ULTRA_LCD))
#if ENABLED(LCD_SET_PROGRESS_MANUALLY) && EITHER(EXTENSIBLE_UI, ULTRA_LCD)
#include "../gcode.h"
#include "../../lcd/ultralcd.h"
@ -42,4 +42,4 @@ void GcodeSuite::M73() {
ui.set_progress(parser.value_byte());
}
#endif // LCD_SET_PROGRESS_MANUALLY && (ENABLED(EXTENSIBLE_UI) || ENABLED(ULTRA_LCD))
#endif // LCD_SET_PROGRESS_MANUALLY && (EXTENSIBLE_UI || ULTRA_LCD)

View File

@ -25,7 +25,7 @@
#include "../../Marlin.h"
#if ENABLED(FWRETRACT) && ENABLED(FWRETRACT_AUTORETRACT)
#if BOTH(FWRETRACT, FWRETRACT_AUTORETRACT)
#include "../../feature/fwretract.h"
#endif
@ -79,7 +79,7 @@ void GcodeSuite::G0_G1(
}
#endif
#if ENABLED(FWRETRACT) && ENABLED(FWRETRACT_AUTORETRACT)
#if BOTH(FWRETRACT, FWRETRACT_AUTORETRACT)
if (MIN_AUTORETRACT <= MAX_AUTORETRACT) {
// When M209 Autoretract is enabled, convert E-only moves to firmware retract/recover moves

View File

@ -95,7 +95,7 @@ void enqueue_and_echo_commands_P(PGM_P const pgcode);
*/
bool enqueue_and_echo_command(const char* cmd);
#define HAS_LCD_QUEUE_NOW (ENABLED(MALYAN_LCD) || (HAS_LCD_MENU && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE))))
#define HAS_LCD_QUEUE_NOW (ENABLED(MALYAN_LCD) || (HAS_LCD_MENU && ANY(AUTO_BED_LEVELING_UBL, PID_AUTOTUNE_MENU, ADVANCED_PAUSE_FEATURE)))
#define HAS_QUEUE_NOW (ENABLED(SDSUPPORT) || HAS_LCD_QUEUE_NOW)
#if HAS_QUEUE_NOW

View File

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h"
#if ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_GCODE)
#if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE)
#include "../gcode.h"
#include "../../sd/cardreader.h"

View File

@ -125,7 +125,7 @@ void GcodeSuite::M109() {
print_job_timer.start();
#endif
#if ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI)
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
if (thermalManager.isHeatingHotend(target_extruder) || !no_wait_for_cooling)
thermalManager.set_heating_message(target_extruder);
#endif

View File

@ -64,7 +64,7 @@
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
#elif ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) || ENABLED(AZSMZ_12864)
#elif ANY(miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864)
#define ULTRA_LCD
#define DOGLCD
@ -141,7 +141,7 @@
#endif
#if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL)
#if EITHER(MAKRPANEL, MINIPANEL)
#define DOGLCD
#define ULTIPANEL
#define DEFAULT_LCD_CONTRAST 17
@ -159,13 +159,13 @@
#endif
// 128x64 I2C OLED LCDs - SSD1306/SSD1309/SH1106
#define HAS_SSD1306_OLED_I2C (ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SSD1309) || ENABLED(U8GLIB_SH1106))
#define HAS_SSD1306_OLED_I2C ANY(U8GLIB_SSD1306, U8GLIB_SSD1309, U8GLIB_SH1106)
#if HAS_SSD1306_OLED_I2C
#define ULTRA_LCD
#define DOGLCD
#endif
#if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106)
#if EITHER(PANEL_ONE, U8GLIB_SH1106)
#define ULTIMAKERCONTROLLER
@ -177,17 +177,13 @@
#endif
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(LCD_FOR_MELZI) || ENABLED(SILVER_GATE_GLCD_CONTROLLER)
#if ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, LCD_FOR_MELZI, SILVER_GATE_GLCD_CONTROLLER)
#define DOGLCD
#define U8GLIB_ST7920
#define REPRAP_DISCOUNT_SMART_CONTROLLER
#endif
#if ENABLED(ULTIMAKERCONTROLLER) \
|| ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
|| ENABLED(G3D_PANEL) \
|| ENABLED(RIGIDBOT_PANEL) \
|| ENABLED(ULTI_CONTROLLER)
#if ANY(ULTIMAKERCONTROLLER, REPRAP_DISCOUNT_SMART_CONTROLLER, G3D_PANEL, RIGIDBOT_PANEL, ULTI_CONTROLLER)
#define ULTIPANEL
#endif
@ -223,7 +219,7 @@
* I2C PANELS
*/
#if ENABLED(LCD_SAINSMART_I2C_1602) || ENABLED(LCD_SAINSMART_I2C_2004)
#if EITHER(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004)
#define LCD_I2C_TYPE_PCF8575
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
@ -267,15 +263,11 @@
#define STD_ENCODER_PULSES_PER_STEP 2
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
#elif ENABLED(miniVIKI) || ENABLED(VIKI2) \
|| ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
|| ENABLED(AZSMZ_12864) \
|| ENABLED(OLED_PANEL_TINYBOY2) \
|| ENABLED(BQ_LCD_SMART_CONTROLLER) \
|| ENABLED(LCD_I2C_PANELOLU2) \
|| ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
#elif ANY(miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864, OLED_PANEL_TINYBOY2, BQ_LCD_SMART_CONTROLLER, LCD_I2C_PANELOLU2, REPRAP_DISCOUNT_SMART_CONTROLLER)
#define STD_ENCODER_PULSES_PER_STEP 4
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
#endif
#ifndef STD_ENCODER_PULSES_PER_STEP
@ -400,16 +392,16 @@
#endif
// No inactive extruders with MK2_MULTIPLEXER or SWITCHING_NOZZLE
#if ENABLED(MK2_MULTIPLEXER) || ENABLED(SWITCHING_NOZZLE)
#if EITHER(MK2_MULTIPLEXER, SWITCHING_NOZZLE)
#undef DISABLE_INACTIVE_EXTRUDER
#endif
// Prusa MK2 Multiplexer and MMU 2.0 force SINGLENOZZLE
#if ENABLED(MK2_MULTIPLEXER) || ENABLED(PRUSA_MMU2)
#if EITHER(MK2_MULTIPLEXER, PRUSA_MMU2)
#define SINGLENOZZLE
#endif
#if ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset
#if EITHER(SINGLENOZZLE, MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset
#undef HOTENDS
#define HOTENDS 1
#undef TEMP_SENSOR_1_AS_REDUNDANT
@ -435,7 +427,7 @@
#define SWITCHING_NOZZLE_TWO_SERVOS defined(SWITCHING_NOZZLE_E1_SERVO_NR)
#define HAS_HOTEND_OFFSET (HOTENDS > 1)
#define HAS_DUPLICATION_MODE (ENABLED(DUAL_X_CARRIAGE) || ENABLED(MULTI_NOZZLE_DUPLICATION))
#define HAS_DUPLICATION_MODE EITHER(DUAL_X_CARRIAGE, MULTI_NOZZLE_DUPLICATION)
/**
* DISTINCT_E_FACTORS affects how some E factors are accessed
@ -506,8 +498,8 @@
/**
* Set flags for enabled probes
*/
#define HAS_BED_PROBE (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_PROBE || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE) || ENABLED(SENSORLESS_PROBING) || ENABLED(RACK_AND_PINION_PROBE))
#define PROBE_SELECTED (HAS_BED_PROBE || ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING))
#define HAS_BED_PROBE (HAS_Z_SERVO_PROBE || ANY(FIX_MOUNTED_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, SOLENOID_PROBE, SENSORLESS_PROBING, RACK_AND_PINION_PROBE))
#define PROBE_SELECTED (HAS_BED_PROBE || EITHER(PROBE_MANUALLY, MESH_BED_LEVELING))
#if HAS_BED_PROBE
#define USES_Z_MIN_PROBE_ENDSTOP DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
@ -528,19 +520,19 @@
#define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y))
#endif
#define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS))
#define HAS_RESUME_CONTINUE (ENABLED(EXTENSIBLE_UI) || ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER))
#define HAS_COLOR_LEDS (ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(PCA9533) || ENABLED(NEOPIXEL_LED))
#define HAS_LEDS_OFF_FLAG (ENABLED(PRINTER_EVENT_LEDS) && ENABLED(SDSUPPORT) && HAS_RESUME_CONTINUE)
#define HAS_PRINT_PROGRESS (ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY))
#define HAS_SOFTWARE_ENDSTOPS EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
#define HAS_RESUME_CONTINUE ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER)
#define HAS_COLOR_LEDS ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED)
#define HAS_LEDS_OFF_FLAG (BOTH(PRINTER_EVENT_LEDS, SDSUPPORT) && HAS_RESUME_CONTINUE)
#define HAS_PRINT_PROGRESS EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
#define HAS_SERVICE_INTERVALS (SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0)
#define HAS_FILAMENT_SENSOR ENABLED(FILAMENT_RUNOUT_SENSOR)
#define Z_MULTI_STEPPER_DRIVERS (ENABLED(Z_DUAL_STEPPER_DRIVERS) || ENABLED(Z_TRIPLE_STEPPER_DRIVERS))
#define Z_MULTI_ENDSTOPS (ENABLED(Z_DUAL_ENDSTOPS) || ENABLED(Z_TRIPLE_ENDSTOPS))
#define HAS_EXTRA_ENDSTOPS (ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS)
#define Z_MULTI_STEPPER_DRIVERS EITHER(Z_DUAL_STEPPER_DRIVERS, Z_TRIPLE_STEPPER_DRIVERS)
#define Z_MULTI_ENDSTOPS EITHER(Z_DUAL_ENDSTOPS, Z_TRIPLE_ENDSTOPS)
#define HAS_EXTRA_ENDSTOPS (EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS)
#define IS_SCARA (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA))
#define IS_SCARA EITHER(MORGAN_SCARA, MAKERARM_SCARA)
#define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA)
#define IS_CARTESIAN !IS_KINEMATIC

View File

@ -106,9 +106,9 @@
/**
* CoreXY, CoreXZ, and CoreYZ - and their reverse
*/
#define CORE_IS_XY (ENABLED(COREXY) || ENABLED(COREYX))
#define CORE_IS_XZ (ENABLED(COREXZ) || ENABLED(COREZX))
#define CORE_IS_YZ (ENABLED(COREYZ) || ENABLED(COREZY))
#define CORE_IS_XY EITHER(COREXY, COREYX)
#define CORE_IS_XZ EITHER(COREXZ, COREZX)
#define CORE_IS_YZ EITHER(COREYZ, COREZY)
#define IS_CORE (CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ)
#if IS_CORE
#if CORE_IS_XY
@ -124,7 +124,7 @@
#define CORE_AXIS_1 B_AXIS
#define CORE_AXIS_2 C_AXIS
#endif
#if ENABLED(COREYX) || ENABLED(COREZX) || ENABLED(COREZY)
#if ANY(COREYX, COREZX, COREZY)
#define CORESIGN(n) (-(n))
#else
#define CORESIGN(n) (n)
@ -426,7 +426,7 @@
#define HEATER_CHAMBER_USES_THERMISTOR
#endif
#define HOTEND_USES_THERMISTOR (ENABLED(HEATER_0_USES_THERMISTOR) || ENABLED(HEATER_1_USES_THERMISTOR) || ENABLED(HEATER_2_USES_THERMISTOR) || ENABLED(HEATER_3_USES_THERMISTOR) || ENABLED(HEATER_4_USES_THERMISTOR))
#define HOTEND_USES_THERMISTOR ANY(HEATER_0_USES_THERMISTOR, HEATER_1_USES_THERMISTOR, HEATER_2_USES_THERMISTOR, HEATER_3_USES_THERMISTOR, HEATER_4_USES_THERMISTOR)
/**
* Default hotend offsets, if not defined
@ -877,8 +877,8 @@
#define AXIS_HAS_STALLGUARD(ST) (AXIS_DRIVER_TYPE(ST, TMC2130) || AXIS_DRIVER_TYPE(ST, TMC2160) || AXIS_DRIVER_TYPE(ST, TMC2660) || AXIS_DRIVER_TYPE(ST, TMC5130) || AXIS_DRIVER_TYPE(ST, TMC5160))
#define AXIS_HAS_STEALTHCHOP(ST) (AXIS_DRIVER_TYPE(ST, TMC2130) || AXIS_DRIVER_TYPE(ST, TMC2160) || AXIS_DRIVER_TYPE(ST, TMC2208) || AXIS_DRIVER_TYPE(ST, TMC5130) || AXIS_DRIVER_TYPE(ST, TMC5160))
#define STEALTHCHOP_ENABLED (ENABLED(STEALTHCHOP_XY) || ENABLED(STEALTHCHOP_Z) || ENABLED(STEALTHCHOP_E))
#define USE_SENSORLESS (ENABLED(SENSORLESS_HOMING) || ENABLED(SENSORLESS_PROBING))
#define STEALTHCHOP_ENABLED ANY(STEALTHCHOP_XY, STEALTHCHOP_Z, STEALTHCHOP_E)
#define USE_SENSORLESS EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING)
// Disable Z axis sensorless homing if a probe is used to home the Z axis
#if HOMING_Z_WITH_PROBE
#undef Z_STALL_SENSITIVITY
@ -940,8 +940,8 @@
#if !HAS_HEATED_BED
#undef PIDTEMPBED
#endif
#define HAS_PID_HEATING (ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED))
#define HAS_PID_FOR_BOTH (ENABLED(PIDTEMP) && ENABLED(PIDTEMPBED))
#define HAS_PID_HEATING EITHER(PIDTEMP, PIDTEMPBED)
#define HAS_PID_FOR_BOTH BOTH(PIDTEMP, PIDTEMPBED)
// Thermal protection
#define HAS_THERMALLY_PROTECTED_BED (HAS_HEATED_BED && ENABLED(THERMAL_PROTECTION_BED))
@ -976,9 +976,9 @@
#define Z_PROBE_SERVO_NR -1
#endif
#define HAS_SERVO_ANGLES (ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE) || (HAS_Z_SERVO_PROBE && defined(Z_PROBE_SERVO_NR)))
#define HAS_SERVO_ANGLES (EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE) || (HAS_Z_SERVO_PROBE && defined(Z_PROBE_SERVO_NR)))
#if !HAS_SERVO_ANGLES
#if !HAS_SERVO_ANGLES || ENABLED(BLTOUCH)
#undef EDITABLE_SERVO_ANGLES
#endif
@ -996,7 +996,7 @@
// Digital control
#define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET))
#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
#define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_X) || PIN_EXISTS(MOTOR_CURRENT_PWM_Y) || PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E))
#define HAS_MOTOR_CURRENT_PWM ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z, MOTOR_CURRENT_PWM_E)
#define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS || HAS_E5_MICROSTEPS)
@ -1055,7 +1055,7 @@
#undef AUTO_REPORT_TEMPERATURES
#endif
#define HAS_AUTO_REPORTING (ENABLED(AUTO_REPORT_TEMPERATURES) || ENABLED(AUTO_REPORT_SD_STATUS))
#define HAS_AUTO_REPORTING EITHER(AUTO_REPORT_TEMPERATURES, AUTO_REPORT_SD_STATUS)
/**
* This setting is also used by M109 when trying to calculate
@ -1272,14 +1272,14 @@
/**
* Set granular options based on the specific type of leveling
*/
#define UBL_SEGMENTED (ENABLED(AUTO_BED_LEVELING_UBL) && (ENABLED(DELTA)))
#define ABL_PLANAR (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT))
#define ABL_GRID (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR))
#define UBL_SEGMENTED BOTH(AUTO_BED_LEVELING_UBL, DELTA)
#define ABL_PLANAR EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT)
#define ABL_GRID EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)
#define HAS_ABL_NOT_UBL (ABL_PLANAR || ABL_GRID)
#define HAS_ABL_OR_UBL (HAS_ABL_NOT_UBL || ENABLED(AUTO_BED_LEVELING_UBL))
#define HAS_LEVELING (HAS_ABL_OR_UBL || ENABLED(MESH_BED_LEVELING))
#define HAS_AUTOLEVEL (HAS_ABL_OR_UBL && DISABLED(PROBE_MANUALLY))
#define HAS_MESH (ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(MESH_BED_LEVELING))
#define HAS_MESH ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
#define PLANNER_LEVELING (HAS_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL))
#define HAS_PROBING_PROCEDURE (HAS_ABL_OR_UBL || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST))
#define HAS_POSITION_MODIFIERS (ENABLED(FWRETRACT) || HAS_LEVELING || ENABLED(SKEW_CORRECTION))
@ -1297,8 +1297,8 @@
#undef NO_FAN_SLOWING_IN_PID_TUNING
#endif
#define QUIET_PROBING (HAS_BED_PROBE && (ENABLED(PROBING_HEATERS_OFF) || ENABLED(PROBING_FANS_OFF) || DELAY_BEFORE_PROBING > 0))
#define HEATER_IDLE_HANDLER (ENABLED(ADVANCED_PAUSE_FEATURE) || ENABLED(PROBING_HEATERS_OFF))
#define QUIET_PROBING (HAS_BED_PROBE && (EITHER(PROBING_HEATERS_OFF, PROBING_FANS_OFF) || DELAY_BEFORE_PROBING > 0))
#define HEATER_IDLE_HANDLER EITHER(ADVANCED_PAUSE_FEATURE, PROBING_HEATERS_OFF)
#if ENABLED(ADVANCED_PAUSE_FEATURE) && !defined(FILAMENT_CHANGE_SLOW_LOAD_LENGTH)
#define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0
@ -1400,7 +1400,7 @@
/**
* Default mesh area is an area with an inset margin on the print area.
*/
#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL)
#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
#if IS_KINEMATIC
// Probing points may be verified at compile time within the radius
// using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(DELTA_PRINTABLE_RADIUS),"bad probe point!")
@ -1440,7 +1440,7 @@
#endif // MESH_BED_LEVELING || AUTO_BED_LEVELING_UBL
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_3POINT)
#if EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT)
#if IS_KINEMATIC
#define SIN0 0.0
#define SIN120 0.866025
@ -1488,7 +1488,7 @@
#endif
#endif
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)
#ifndef LEFT_PROBE_BED_POSITION
#define LEFT_PROBE_BED_POSITION MIN_PROBE_X
#endif
@ -1582,7 +1582,7 @@
#endif
// Add commands that need sub-codes to this list
#define USE_GCODE_SUBCODES ENABLED(G38_PROBE_TARGET) || ENABLED(CNC_COORDINATE_SYSTEMS) || ENABLED(POWER_LOSS_RECOVERY)
#define USE_GCODE_SUBCODES ANY(G38_PROBE_TARGET, CNC_COORDINATE_SYSTEMS, POWER_LOSS_RECOVERY)
// Parking Extruder
#if ENABLED(PARKING_EXTRUDER)
@ -1624,8 +1624,8 @@
#endif
#endif
// Nozzle park
#if ENABLED(NOZZLE_PARK_FEATURE) && ENABLED(DELTA)
// Nozzle park for Delta
#if BOTH(NOZZLE_PARK_FEATURE, DELTA)
#undef NOZZLE_PARK_Z_FEEDRATE
#define NOZZLE_PARK_Z_FEEDRATE NOZZLE_PARK_XY_FEEDRATE
#endif
@ -1666,7 +1666,7 @@
// If platform requires early initialization of watchdog to properly boot
#define EARLY_WATCHDOG (ENABLED(USE_WATCHDOG) && defined(ARDUINO_ARCH_SAM))
#define USE_EXECUTE_COMMANDS_IMMEDIATE (ENABLED(G29_RETRY_AND_RECOVER) || ENABLED(GCODE_MACROS) || ENABLED(POWER_LOSS_RECOVERY) || HAS_DRIVER(L6470))
#define USE_EXECUTE_COMMANDS_IMMEDIATE (ANY(G29_RETRY_AND_RECOVER, GCODE_MACROS, POWER_LOSS_RECOVERY) || HAS_DRIVER(L6470))
#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
#define Z_STEPPER_COUNT 3

View File

@ -395,7 +395,7 @@
#elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
#error "TX_BUFFER_SIZE must be 0 or a power of 2 between 1 and 256."
#endif
#elif ENABLED(SERIAL_XON_XOFF) || ENABLED(SERIAL_STATS_MAX_RX_QUEUED) || ENABLED(SERIAL_STATS_DROPPED_RX)
#elif ANY(SERIAL_XON_XOFF, SERIAL_STATS_MAX_RX_QUEUED, SERIAL_STATS_DROPPED_RX)
#error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."
#endif
@ -410,7 +410,7 @@
/**
* Dual / Triple Stepper Drivers
*/
#if ENABLED(X_DUAL_STEPPER_DRIVERS) && ENABLED(DUAL_X_CARRIAGE)
#if BOTH(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE)
#error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS."
#elif ENABLED(X_DUAL_STEPPER_DRIVERS) && !(HAS_X2_ENABLE && HAS_X2_STEP && HAS_X2_DIR)
#error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)."
@ -462,21 +462,21 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "PULLDOWN pin mode is not available on the selected board."
#endif
#if ENABLED(ENDSTOPPULLUPS) && ENABLED(ENDSTOPPULLDOWNS)
#if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS)
#error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS."
#elif ENABLED(FIL_RUNOUT_PULLUP) && ENABLED(FIL_RUNOUT_PULLDOWN)
#elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN)
#error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN."
#elif ENABLED(ENDSTOPPULLUP_XMAX) && ENABLED(ENDSTOPPULLDOWN_XMAX)
#elif BOTH(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX)
#error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX."
#elif ENABLED(ENDSTOPPULLUP_YMAX) && ENABLED(ENDSTOPPULLDOWN_YMAX)
#elif BOTH(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX)
#error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX."
#elif ENABLED(ENDSTOPPULLUP_ZMAX) && ENABLED(ENDSTOPPULLDOWN_ZMAX)
#elif BOTH(ENDSTOPPULLUP_ZMAX, ENDSTOPPULLDOWN_ZMAX)
#error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX."
#elif ENABLED(ENDSTOPPULLUP_XMIN) && ENABLED(ENDSTOPPULLDOWN_XMIN)
#elif BOTH(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN)
#error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
#elif ENABLED(ENDSTOPPULLUP_YMIN) && ENABLED(ENDSTOPPULLDOWN_YMIN)
#elif BOTH(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN)
#error "Enable only one of ENDSTOPPULLUP_Y_MIN or ENDSTOPPULLDOWN_Y_MIN."
#elif ENABLED(ENDSTOPPULLUP_ZMIN) && ENABLED(ENDSTOPPULLDOWN_ZMIN)
#elif BOTH(ENDSTOPPULLUP_ZMIN, ENDSTOPPULLDOWN_ZMIN)
#error "Enable only one of ENDSTOPPULLUP_Z_MIN or ENDSTOPPULLDOWN_Z_MIN."
#endif
@ -513,7 +513,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/**
* Custom Boot and Status screens
*/
#if DISABLED(DOGLCD) && (ENABLED(SHOW_CUSTOM_BOOTSCREEN) || ENABLED(CUSTOM_STATUS_SCREEN_IMAGE))
#if DISABLED(DOGLCD) && EITHER(SHOW_CUSTOM_BOOTSCREEN, CUSTOM_STATUS_SCREEN_IMAGE)
#error "Graphical LCD is required for SHOW_CUSTOM_BOOTSCREEN and CUSTOM_STATUS_SCREEN_IMAGE."
#endif
@ -568,9 +568,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#if ENABLED(BABYSTEPPING)
#if ENABLED(SCARA)
#error "BABYSTEPPING is not implemented for SCARA yet."
#elif ENABLED(DELTA) && ENABLED(BABYSTEP_XY)
#elif BOTH(DELTA, BABYSTEP_XY)
#error "BABYSTEPPING only implemented for Z axis on deltabots."
#elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && ENABLED(MESH_BED_LEVELING)
#elif BOTH(BABYSTEP_ZPROBE_OFFSET, MESH_BED_LEVELING)
#error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
#elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
#error "BABYSTEP_ZPROBE_OFFSET requires a probe."
@ -580,7 +580,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
#elif ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && !HAS_HOTEND_OFFSET
#error "BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS."
#elif ENABLED(BABYSTEP_ALWAYS_AVAILABLE) && ENABLED(MOVE_Z_WHEN_IDLE)
#elif BOTH(BABYSTEP_ALWAYS_AVAILABLE, MOVE_Z_WHEN_IDLE)
#error "BABYSTEP_ALWAYS_AVAILABLE and MOVE_Z_WHEN_IDLE are incompatible."
#endif
#endif
@ -641,7 +641,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/**
* Individual axis homing is useless for DELTAS
*/
#if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) && ENABLED(DELTA)
#if BOTH(INDIVIDUAL_AXIS_HOMING_MENU, DELTA)
#error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
#endif
@ -810,7 +810,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "Enable only one of PARKING_EXTRUDER and MAGNETIC_PARKING_EXTRUDER."
#elif EXTRUDERS != 2
#error "PARKING_EXTRUDER requires exactly 2 EXTRUDERS."
#elif !PIN_EXISTS(SOL0) || !PIN_EXISTS(SOL1)
#elif !PIN_EXISTS(SOL0, SOL1)
#error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN."
#elif !defined(PARKING_EXTRUDER_PARKING_X)
#error "PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X."
@ -907,7 +907,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/**
* Bed Heating Options - PID vs Limit Switching
*/
#if ENABLED(PIDTEMPBED) && ENABLED(BED_LIMIT_SWITCHING)
#if BOTH(PIDTEMPBED, BED_LIMIT_SWITCHING)
#error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED."
#endif
@ -974,7 +974,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/**
* Z_PROBE_SLED is incompatible with DELTA
*/
#if ENABLED(Z_PROBE_SLED) && ENABLED(DELTA)
#if BOTH(Z_PROBE_SLED, DELTA)
#error "You cannot use Z_PROBE_SLED with DELTA."
#endif
@ -1087,7 +1087,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
* Bed Leveling Requirements
*/
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_3POINT)
#if EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT)
static_assert(WITHIN(PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_1_X is outside the probe region.");
static_assert(WITHIN(PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_2_X is outside the probe region.");
static_assert(WITHIN(PROBE_PT_3_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_3_X is outside the probe region.");
@ -1221,8 +1221,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/**
* Make sure DISABLE_[XYZ] compatible with selected homing options
*/
#if ENABLED(DISABLE_X) || ENABLED(DISABLE_Y) || ENABLED(DISABLE_Z)
#if ENABLED(HOME_AFTER_DEACTIVATE) || ENABLED(Z_SAFE_HOMING)
#if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z)
#if EITHER(HOME_AFTER_DEACTIVATE, Z_SAFE_HOMING)
#error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
#endif
#endif
@ -1255,7 +1255,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#if ENABLED(SAV_3DGLCD)
#if DISABLED(U8GLIB_SSD1306) && DISABLED(U8GLIB_SH1106)
#error "Enable a SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
#elif ENABLED(U8GLIB_SSD1306) && ENABLED(U8GLIB_SH1106)
#elif BOTH(U8GLIB_SSD1306, U8GLIB_SH1106)
#error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
#endif
#endif
@ -1334,11 +1334,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
*/
#if !HAS_HEATER_0
#error "HEATER_0_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_0) && !PIN_EXISTS(MAX6675_SS)
#elif !ANY_PIN(TEMP_0, MAX6675_SS)
#error "TEMP_0_PIN not defined for this board."
#elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR)))
#elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && !PIN_EXISTS(E0_STEP, E0_DIR))
#error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !HAS_E0_ENABLE))
#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP, E0_DIR) || !HAS_E0_ENABLE))
#error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
#elif TEMP_SENSOR_0 == 0
#error "TEMP_SENSOR_0 is required."
@ -1356,7 +1356,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board."
#elif TEMP_SENSOR_1 == 0
#error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
#elif !PIN_EXISTS(TEMP_1) && !PIN_EXISTS(MAX6675_SS2)
#elif !ANY_PIN(TEMP_1, MAX6675_SS2)
#error "TEMP_1_PIN not defined for this board."
#endif
#if HOTENDS > 2
@ -1434,7 +1434,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/**
* Temperature status LEDs
*/
#if ENABLED(TEMP_STAT_LEDS) && !PIN_EXISTS(STAT_LED_RED) && !PIN_EXISTS(STAT_LED_BLUE)
#if ENABLED(TEMP_STAT_LEDS) && !ANY_PIN(STAT_LED_RED, STAT_LED_BLUE)
#error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both."
#endif
@ -1442,7 +1442,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
* LED Control Menu
*/
#if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS
#error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9632, or NEOPIXEL_LED."
#error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9533, PCA9632, or NEOPIXEL_LED."
#endif
/**
@ -1467,27 +1467,27 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
*/
#if DISABLED(MK2_MULTIPLEXER) // MK2_MULTIPLEXER uses E0 stepper only
#if E_STEPPERS
#if !(PIN_EXISTS(E0_STEP) && PIN_EXISTS(E0_DIR) && HAS_E0_ENABLE)
#if !(PIN_EXISTS(E0_STEP, E0_DIR) && HAS_E0_ENABLE)
#error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 1
#if !(PIN_EXISTS(E1_STEP) && PIN_EXISTS(E1_DIR) && HAS_E1_ENABLE)
#if !(PIN_EXISTS(E1_STEP, E1_DIR) && HAS_E1_ENABLE)
#error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 2
#if !(PIN_EXISTS(E2_STEP) && PIN_EXISTS(E2_DIR) && HAS_E2_ENABLE)
#if !(PIN_EXISTS(E2_STEP, E2_DIR) && HAS_E2_ENABLE)
#error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 3
#if !(PIN_EXISTS(E3_STEP) && PIN_EXISTS(E3_DIR) && HAS_E3_ENABLE)
#if !(PIN_EXISTS(E3_STEP, E3_DIR) && HAS_E3_ENABLE)
#error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 4
#if !(PIN_EXISTS(E4_STEP) && PIN_EXISTS(E4_DIR) && HAS_E4_ENABLE)
#if !(PIN_EXISTS(E4_STEP, E4_DIR) && HAS_E4_ENABLE)
#error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 5
#if !(PIN_EXISTS(E5_STEP) && PIN_EXISTS(E5_DIR) && HAS_E5_ENABLE)
#if !(PIN_EXISTS(E5_STEP, E5_DIR) && HAS_E5_ENABLE)
#error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
#endif
#endif // E_STEPPERS > 5
@ -1675,9 +1675,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/**
* RGB_LED Requirements
*/
#define _RGB_TEST (PIN_EXISTS(RGB_LED_R) && PIN_EXISTS(RGB_LED_G) && PIN_EXISTS(RGB_LED_B))
#define _RGB_TEST (PIN_EXISTS(RGB_LED_R, RGB_LED_G, RGB_LED_B))
#if ENABLED(PRINTER_EVENT_LEDS) && !HAS_COLOR_LEDS
#error "PRINTER_EVENT_LEDS requires BLINKM, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED."
#error "PRINTER_EVENT_LEDS requires BLINKM, PCA9533, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED."
#elif ENABLED(RGB_LED)
#if !_RGB_TEST
#error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN."
@ -1813,7 +1813,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/**
* Check existing RX/TX pins against enable TMC UART drivers.
*/
#define INVALID_TMC2208(ST) (AXIS_DRIVER_TYPE(ST, TMC2208) && !(defined(ST##_HARDWARE_SERIAL) || (PIN_EXISTS(ST##_SERIAL_RX) && PIN_EXISTS(ST##_SERIAL_TX))))
#define INVALID_TMC2208(ST) (AXIS_DRIVER_TYPE(ST, TMC2208) && !(defined(ST##_HARDWARE_SERIAL) || (PIN_EXISTS(ST##_SERIAL_RX, ST##_SERIAL_TX))))
#if INVALID_TMC2208(X)
#error "TMC2208 on X requires X_HARDWARE_SERIAL or X_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC2208(X2)
@ -1887,7 +1887,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
// is necessary in order to reset the stallGuard indication between the initial movement of all three
// towers to +Z and the individual homing of each tower. This restriction can be removed once a means of
// clearing the stallGuard activated status is found.
#if ENABLED(DELTA) && !(ENABLED(STEALTHCHOP_XY) && ENABLED(STEALTHCHOP_Z))
#if ENABLED(DELTA) && !BOTH(STEALTHCHOP_XY, STEALTHCHOP_Z)
#error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z."
#elif X_SENSORLESS && X_HOME_DIR == -1 && (!X_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMIN))
#error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMIN when homing to X_MIN."
@ -1909,7 +1909,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
// Sensorless homing/probing requirements
#if ENABLED(SENSORLESS_HOMING) && !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS)
#error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, or Z axes."
#elif ENABLED(SENSORLESS_PROBING) && ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS)
#elif BOTH(SENSORLESS_PROBING, DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS)
#error "SENSORLESS_PROBING for DELTA requires TMC stepper drivers with StallGuard on X, Y, and Z axes."
#elif ENABLED(SENSORLESS_PROBING) && !Z_SENSORLESS
#error "SENSORLESS_PROBING requires a TMC stepper driver with StallGuard on Z."
@ -1981,7 +1981,7 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
#undef _ARR_TEST
#if ENABLED(CNC_COORDINATE_SYSTEMS) && ENABLED(NO_WORKSPACE_OFFSETS)
#if BOTH(CNC_COORDINATE_SYSTEMS, NO_WORKSPACE_OFFSETS)
#error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS."
#endif
@ -2036,7 +2036,7 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
#error "PRINTCOUNTER requires EEPROM_SETTINGS. Please update your Configuration."
#endif
#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !(PIN_EXISTS(USB_CS) && PIN_EXISTS(USB_INTR))
#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !PIN_EXISTS(USB_CS, USB_INTR)
#error "USB_CS_PIN and USB_INTR_PIN are required for USB_FLASH_DRIVE_SUPPORT."
#endif

View File

@ -40,7 +40,7 @@
#include "../../module/planner.h"
#include "../../module/motion.h"
#if DISABLED(LCD_PROGRESS_BAR) && ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
#if DISABLED(LCD_PROGRESS_BAR) && BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
#include "../../feature/filwidth.h"
#include "../../gcode/parser.h"
#endif
@ -57,7 +57,7 @@
LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_I2C_PIN_EN, LCD_I2C_PIN_RW, LCD_I2C_PIN_RS, LCD_I2C_PIN_D4, LCD_I2C_PIN_D5, LCD_I2C_PIN_D6, LCD_I2C_PIN_D7);
#elif ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008)
#elif EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008)
LCD_CLASS lcd(LCD_I2C_ADDRESS
#ifdef DETECT_DEVICE
@ -628,7 +628,7 @@ void MarlinUI::draw_status_message(const bool blink) {
if (progress > 2) return draw_progress_bar(progress);
}
#elif ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
#elif BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
// Alternate Status message and Filament display
if (ELAPSED(millis(), next_filament_display)) {

View File

@ -572,7 +572,7 @@ void MarlinUI::draw_status_screen() {
if (PAGE_CONTAINS(STATUS_BASELINE - INFO_FONT_ASCENT, STATUS_BASELINE + INFO_FONT_DESCENT)) {
lcd_moveto(0, STATUS_BASELINE);
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
// Alternate Status message and Filament display
if (ELAPSED(millis(), next_filament_display)) {
lcd_put_u8str_P(PSTR(LCD_STR_FILAM_DIA));

View File

@ -862,7 +862,7 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) {
}
void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) {
#if ENABLED(LCD_SET_PROGRESS_MANUALLY) || ENABLED(SDSUPPORT)
#if EITHER(LCD_SET_PROGRESS_MANUALLY, SDSUPPORT)
// Since the progress bar involves writing
// quite a few bytes to GDRAM, only do this

View File

@ -189,7 +189,7 @@ void MarlinUI::init_lcd() {
OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH);
#endif
#if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)
#if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
SET_OUTPUT(LCD_PINS_DC);
#if !defined(LCD_RESET_PIN)
#define LCD_RESET_PIN LCD_PINS_RS
@ -497,7 +497,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
#endif // AUTO_BED_LEVELING_UBL
#if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) || ENABLED(MESH_EDIT_GFX_OVERLAY)
#if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
const unsigned char cw_bmp[] PROGMEM = {
B00000011,B11111000,B00000000,

View File

@ -59,7 +59,7 @@
#include "../../core/utility.h"
#endif
#if DO_SWITCH_EXTRUDER || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
#if DO_SWITCH_EXTRUDER || EITHER(SWITCHING_NOZZLE, PARKING_EXTRUDER)
#include "../../module/tool_change.h"
#endif
@ -297,7 +297,7 @@ namespace ExtUI {
void setActiveTool(const extruder_t extruder, bool no_move) {
#if EXTRUDERS > 1
const uint8_t e = extruder - E0;
#if DO_SWITCH_EXTRUDER || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
#if DO_SWITCH_EXTRUDER || EITHER(SWITCHING_NOZZLE, PARKING_EXTRUDER)
if (e != active_extruder)
tool_change(e, 0, no_move);
#endif

View File

@ -45,7 +45,7 @@
#include "../../module/probe.h"
#endif
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) || ENABLED(AUTO_BED_LEVELING_UBL)
#if EITHER(ENABLE_LEVELING_FADE_HEIGHT, AUTO_BED_LEVELING_UBL)
#include "../../feature/bedlevel/bedlevel.h"
#endif
@ -205,7 +205,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) {
lcd_z_fade_height = planner.z_fade_height;
#endif
#if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) && ENABLED(BABYSTEPPING)
#if BOTH(DOUBLECLICK_FOR_Z_BABYSTEPPING, BABYSTEPPING)
static millis_t doubleclick_expire_ms = 0;
// Going to menu_main from status screen? Remember first click time.
// Going back to status screen within a very short time? Go to Z babystepping.
@ -405,7 +405,7 @@ void MarlinUI::completion_feedback(const bool good/*=true*/) {
#endif // BABYSTEP_ZPROBE_OFFSET
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE)
#if ANY(AUTO_BED_LEVELING_UBL, PID_AUTOTUNE_MENU, ADVANCED_PAUSE_FEATURE)
void lcd_enqueue_command(const char * const cmd) {
no_reentry = true;

View File

@ -82,7 +82,7 @@ FORCE_INLINE void draw_menu_item_edit_P(const bool sel, const uint8_t row, PGM_P
FORCE_INLINE void draw_menu_item_sdfolder(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) { draw_sd_menu_item(sel, row, pstr, theCard, true); }
#endif
#if HAS_GRAPHICAL_LCD && (ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) || ENABLED(MESH_EDIT_GFX_OVERLAY))
#if HAS_GRAPHICAL_LCD && EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
void _lcd_zoffset_overlay_gfx(const float zvalue);
#endif
@ -340,13 +340,13 @@ void menu_move();
void lcd_move_z();
void _lcd_draw_homing();
#define HAS_LINE_TO_Z (ENABLED(DELTA) || ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING) || ENABLED(LEVEL_BED_CORNERS))
#define HAS_LINE_TO_Z ANY(DELTA, PROBE_MANUALLY, MESH_BED_LEVELING, LEVEL_BED_CORNERS)
#if HAS_LINE_TO_Z
void line_to_z(const float &z);
#endif
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE)
#if ANY(AUTO_BED_LEVELING_UBL, PID_AUTOTUNE_MENU, ADVANCED_PAUSE_FEATURE)
void lcd_enqueue_command(const char * const cmd);
void lcd_enqueue_commands_P(PGM_P const cmd);
#endif

View File

@ -321,7 +321,7 @@ void menu_tmc();
#endif // PID_PARAMS_PER_HOTEND
#endif // HOTENDS
#define SHOW_MENU_ADVANCED_TEMPERATURE ((ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(PID_EDIT_MENU))
#define SHOW_MENU_ADVANCED_TEMPERATURE ((ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND) || EITHER(PID_AUTOTUNE_MENU, PID_EDIT_MENU))
//
// Advanced Settings > Temperature

View File

@ -36,7 +36,7 @@
#include "../../module/probe.h"
#endif
#if ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING)
#if EITHER(PROBE_MANUALLY, MESH_BED_LEVELING)
#include "../../module/motion.h"
#include "../../gcode/queue.h"
@ -244,7 +244,7 @@ void menu_bed_leveling() {
#endif
// Level Bed
#if ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING)
#if EITHER(PROBE_MANUALLY, MESH_BED_LEVELING)
// Manual leveling uses a guided procedure
MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
#else

View File

@ -275,7 +275,7 @@ void menu_configuration() {
//
// Delta Calibration
//
#if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION)
#if EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION)
MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, menu_delta_calibrate);
#endif

View File

@ -26,7 +26,7 @@
#include "../../inc/MarlinConfigPre.h"
#if HAS_LCD_MENU && (ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION))
#if HAS_LCD_MENU && EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION)
#include "menu.h"
#include "../../module/delta.h"

View File

@ -58,7 +58,7 @@ void menu_led_custom() {
MENU_ITEM_EDIT_CALLBACK(uint8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true);
MENU_ITEM_EDIT_CALLBACK(uint8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true);
MENU_ITEM_EDIT_CALLBACK(uint8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true);
#if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
#if EITHER(RGBW_LED, NEOPIXEL_LED)
MENU_ITEM_EDIT_CALLBACK(uint8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true);
#if ENABLED(NEOPIXEL_LED)
MENU_ITEM_EDIT_CALLBACK(uint8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true);

View File

@ -46,8 +46,8 @@
#include "../../feature/host_actions.h"
#endif
#define MACHINE_CAN_STOP (ENABLED(SDSUPPORT) || ENABLED(HOST_PROMPT_SUPPORT) || defined(ACTION_ON_CANCEL))
#define MACHINE_CAN_PAUSE (ENABLED(SDSUPPORT) || ENABLED(HOST_PROMPT_SUPPORT) || ENABLED(PARK_HEAD_ON_PAUSE) || defined(ACTION_ON_PAUSE))
#define MACHINE_CAN_STOP (EITHER(SDSUPPORT, HOST_PROMPT_SUPPORT) || defined(ACTION_ON_CANCEL))
#define MACHINE_CAN_PAUSE (ANY(SDSUPPORT, HOST_PROMPT_SUPPORT, PARK_HEAD_ON_PAUSE) || defined(ACTION_ON_PAUSE))
#if MACHINE_CAN_PAUSE

View File

@ -335,7 +335,7 @@ void menu_move() {
else
MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
#if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE)
#if EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE)
#if EXTRUDERS == 6
switch (active_extruder) {
@ -376,7 +376,7 @@ void menu_move() {
#endif
#if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE)
#if EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE)
// Only the current...
MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount);

View File

@ -107,7 +107,7 @@ void menu_tune() {
//
// Manual bed leveling, Bed Z:
//
#if ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING)
#if BOTH(MESH_BED_LEVELING, LCD_BED_LEVELING)
MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1);
#endif

View File

@ -23,7 +23,7 @@
#include "../inc/MarlinConfigPre.h"
// These displays all share the MarlinUI class
#if HAS_SPI_LCD || ENABLED(MALYAN_LCD) || ENABLED(EXTENSIBLE_UI)
#if HAS_SPI_LCD || EITHER(MALYAN_LCD, EXTENSIBLE_UI)
#include "ultralcd.h"
MarlinUI ui;
#include "../sd/cardreader.h"
@ -106,7 +106,7 @@
uint8_t MarlinUI::lcd_status_update_delay = 1; // First update one loop delayed
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
millis_t MarlinUI::next_filament_display; // = 0
#endif
@ -181,7 +181,7 @@ millis_t next_button_update_ms;
return click;
}
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)
#if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)
bool MarlinUI::external_control; // = false
@ -449,7 +449,7 @@ void MarlinUI::status_screen() {
#if HAS_LCD_MENU
if (use_click()) {
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
next_filament_display = millis() + 5000UL; // Show status message for 5s
#endif
goto_screen(menu_main);
@ -638,7 +638,7 @@ LCDViewAction MarlinUI::lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW;
bool MarlinUI::detected() {
return
#if (ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008)) && defined(DETECT_DEVICE)
#if EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) && defined(DETECT_DEVICE)
lcd.LcdDetected() == 1
#else
true
@ -1008,7 +1008,7 @@ void MarlinUI::update() {
#if HAS_DIGITAL_BUTTONS
#if BUTTON_EXISTS(EN1) || BUTTON_EXISTS(EN2) || BUTTON_EXISTS(ENC) || BUTTON_EXISTS(BACK)
#if ANY_BUTTON(EN1, EN2, ENC, BACK)
uint8_t newbutton = 0;
@ -1034,7 +1034,7 @@ void MarlinUI::update() {
//
// Directional buttons
//
#if BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT)
#if ANY_BUTTON(UP, DWN, LFT, RT)
const int8_t pulses = (ENCODER_PULSES_PER_STEP) * encoderDirection;
@ -1175,7 +1175,7 @@ void MarlinUI::update() {
#endif
#endif
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
next_filament_display = millis() + 5000UL; // Show status message for 5s
#endif

View File

@ -27,18 +27,13 @@
#include "../libs/buzzer.h"
#endif
#define HAS_DIGITAL_BUTTONS (!HAS_ADC_BUTTONS && ENABLED(NEWPANEL) \
|| (BUTTON_EXISTS(EN1) && BUTTON_EXISTS(EN2)) \
|| BUTTON_EXISTS(ENC) || BUTTON_EXISTS(BACK) \
|| BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) \
|| BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT))
#define HAS_DIGITAL_BUTTONS (!HAS_ADC_BUTTONS && ENABLED(NEWPANEL) || BUTTON_EXISTS(EN1, EN2) || ANY_BUTTON(ENC, BACK, UP, DWN, LFT, RT))
#define HAS_SHIFT_ENCODER (!HAS_ADC_BUTTONS && (ENABLED(REPRAPWORLD_KEYPAD) || (HAS_SPI_LCD && DISABLED(NEWPANEL))))
#define HAS_ENCODER_WHEEL ((!HAS_ADC_BUTTONS && ENABLED(NEWPANEL)) || (BUTTON_EXISTS(EN1) && BUTTON_EXISTS(EN2)) )
#define HAS_ENCODER_WHEEL ((!HAS_ADC_BUTTONS && ENABLED(NEWPANEL)) || BUTTON_EXISTS(EN1, EN2))
#define HAS_ENCODER_ACTION (HAS_LCD_MENU || ENABLED(ULTIPANEL_FEEDMULTIPLY))
// I2C buttons must be read in the main thread
#define HAS_SLOW_BUTTONS (ENABLED(LCD_I2C_VIKI) || ENABLED(LCD_I2C_PANELOLU2))
#define HAS_SLOW_BUTTONS EITHER(LCD_I2C_VIKI, LCD_I2C_PANELOLU2)
#if HAS_SPI_LCD
@ -188,7 +183,7 @@
#else
#undef BUTTON_EXISTS
#define BUTTON_EXISTS(BN) false
#define BUTTON_EXISTS(...) false
// Shift register bits correspond to buttons:
#define BL_LE 7 // Left
@ -267,7 +262,7 @@ public:
static void clear_lcd();
static void init_lcd();
#if HAS_SPI_LCD || ENABLED(MALYAN_LCD) || ENABLED(EXTENSIBLE_UI)
#if HAS_SPI_LCD || EITHER(MALYAN_LCD, EXTENSIBLE_UI)
static void init();
static void update();
static void set_alert_status_P(PGM_P message);
@ -343,7 +338,7 @@ public:
static inline void refresh_contrast() { set_contrast(contrast); }
#endif
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
static millis_t next_filament_display;
#endif
@ -466,13 +461,13 @@ public:
#endif
#if ENABLED(LCD_BED_LEVELING) && (ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING))
#if ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING)
static bool wait_for_bl_move;
#else
static constexpr bool wait_for_bl_move = false;
#endif
#if HAS_LCD_MENU && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION))
#if HAS_LCD_MENU && EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)
static bool external_control;
FORCE_INLINE static void capture() { external_control = true; }
FORCE_INLINE static void release() { external_control = false; }
@ -493,7 +488,7 @@ public:
#endif
static void update_buttons();
static inline bool button_pressed() { return BUTTON_CLICK(); }
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)
#if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)
static void wait_for_release();
#endif

View File

@ -23,7 +23,7 @@
#include "../inc/MarlinConfig.h"
#include "../gcode/parser.h"
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(M100_FREE_MEMORY_WATCHER) || ENABLED(DEBUG_GCODE_PARSER) || ENABLED(TMC_DEBUG)
#if ANY(AUTO_BED_LEVELING_UBL, M100_FREE_MEMORY_WATCHER, DEBUG_GCODE_PARSER, TMC_DEBUG)
#include "hex_print_routines.h"

View File

@ -34,7 +34,7 @@
#include "../inc/MarlinConfig.h"
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_LINEAR)
#if EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_LINEAR)
#include "least_squares_fit.h"

View File

@ -22,7 +22,7 @@
#include "../inc/MarlinConfig.h"
#if ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE)
#if EITHER(NOZZLE_CLEAN_FEATURE, NOZZLE_PARK_FEATURE)
#include "nozzle.h"

View File

@ -56,7 +56,7 @@
#include "../gcode/gcode.h"
#include "../Marlin.h"
#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE)
#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
#include "../HAL/shared/persistent_store_api.h"
#endif
@ -194,7 +194,7 @@ typedef struct SettingsDataStruct {
delta_segments_per_second, // M665 S
delta_calibration_radius, // M665 B
delta_tower_angle_trim[ABC]; // M665 XYZ
#elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
#elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
float x2_endstop_adj, // M666 X
y2_endstop_adj, // M666 Y
z2_endstop_adj, // M666 Z (S2)
@ -340,7 +340,7 @@ void MarlinSettings::postprocess() {
fwretract.refresh_autoretract();
#endif
#if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE)
#if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE)
planner.recalculate_max_e_jerk();
#endif
@ -448,7 +448,7 @@ void MarlinSettings::postprocess() {
#if HAS_CLASSIC_JERK
EEPROM_WRITE(planner.max_jerk);
#if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE)
#if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE)
dummy = float(DEFAULT_EJERK);
EEPROM_WRITE(dummy);
#endif
@ -624,7 +624,7 @@ void MarlinSettings::postprocess() {
EEPROM_WRITE(delta_calibration_radius); // 1 float
EEPROM_WRITE(delta_tower_angle_trim); // 3 floats
#elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
#elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
_FIELD_TEST(x2_endstop_adj);
@ -757,7 +757,7 @@ void MarlinSettings::postprocess() {
const fwretract_settings_t autoretract_defaults = { 3, 45, 0, 0, 0, 13, 0, 8 };
EEPROM_WRITE(autoretract_defaults);
#endif
#if ENABLED(FWRETRACT) && ENABLED(FWRETRACT_AUTORETRACT)
#if BOTH(FWRETRACT, FWRETRACT_AUTORETRACT)
EEPROM_WRITE(fwretract.autoretract_enabled);
#else
const bool autoretract_enabled = false;
@ -1167,7 +1167,7 @@ void MarlinSettings::postprocess() {
#if HAS_CLASSIC_JERK
EEPROM_READ(planner.max_jerk);
#if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE)
#if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE)
EEPROM_READ(dummy);
#endif
#else
@ -1340,7 +1340,7 @@ void MarlinSettings::postprocess() {
EEPROM_READ(delta_calibration_radius); // 1 float
EEPROM_READ(delta_tower_angle_trim); // 3 floats
#elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
#elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
_FIELD_TEST(x2_endstop_adj);
@ -1472,7 +1472,7 @@ void MarlinSettings::postprocess() {
fwretract_settings_t fwretract_settings;
EEPROM_READ(fwretract_settings);
#endif
#if ENABLED(FWRETRACT) && ENABLED(FWRETRACT_AUTORETRACT)
#if BOTH(FWRETRACT, FWRETRACT_AUTORETRACT)
EEPROM_READ(fwretract.autoretract_enabled);
#else
bool autoretract_enabled;
@ -2066,7 +2066,7 @@ void MarlinSettings::reset() {
delta_calibration_radius = DELTA_CALIBRATION_RADIUS;
COPY(delta_tower_angle_trim, dta);
#elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
#elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
#if ENABLED(X_DUAL_ENDSTOPS)
endstops.x2_endstop_adj = (
@ -2623,7 +2623,7 @@ void MarlinSettings::reset() {
, " Z", LINEAR_UNIT(delta_tower_angle_trim[C_AXIS])
);
#elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
#elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
CONFIG_ECHO_HEADING("Endstop adjustment:");
CONFIG_ECHO_START();

View File

@ -36,7 +36,7 @@
#include HAL_PATH(../HAL, endstop_interrupts.h)
#endif
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) && ENABLED(SDSUPPORT)
#if BOTH(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED, SDSUPPORT)
#include "printcounter.h" // for print_job_timer
#endif
@ -361,7 +361,7 @@ void Endstops::event_handler() {
ui.status_printf_P(0, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP);
#endif
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) && ENABLED(SDSUPPORT)
#if BOTH(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED, SDSUPPORT)
if (planner.abort_on_endstop_hit) {
card.stopSDPrint();
quickstop_stepper();

View File

@ -47,7 +47,7 @@
#include "../feature/bedlevel/bedlevel.h"
#endif
#if ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI)
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
#include "../lcd/ultralcd.h"
#endif
@ -964,7 +964,7 @@ void clean_up_after_endstop_or_probe_move() {
void prepare_move_to_destination() {
apply_motion_limits(destination);
#if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE)
#if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE)
if (!DEBUGGING(DRYRUN)) {
if (destination[E_AXIS] != current_position[E_AXIS]) {
@ -1025,7 +1025,7 @@ bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool
if (zz) SERIAL_CHAR('Z');
SERIAL_ECHOLNPGM(" " MSG_FIRST);
#if ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI)
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
ui.status_printf_P(0, PSTR(MSG_HOME " %s%s%s " MSG_FIRST), xx ? MSG_X : "", yy ? MSG_Y : "", zz ? MSG_Z : "");
#endif
return true;

View File

@ -128,7 +128,7 @@ float Planner::steps_to_mm[XYZE_N]; // (mm) Millimeters per step
#endif
#endif
#if HAS_CLASSIC_JERK
#if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE)
#if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE)
float Planner::max_jerk[XYZ]; // (mm/s^2) M205 XYZ - The largest speed change requiring no acceleration.
#else
float Planner::max_jerk[XYZE]; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration.
@ -1751,7 +1751,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
SERIAL_ECHOLNPGM(" steps)");
//*/
#if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE)
#if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE)
if (de) {
#if ENABLED(PREVENT_COLD_EXTRUSION)
if (thermalManager.tooColdToExtrude(extruder)) {
@ -2104,7 +2104,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
const uint8_t moves_queued = nonbusy_movesplanned();
// Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
#if ENABLED(SLOWDOWN) || ENABLED(ULTRA_LCD) || defined(XY_FREQUENCY_LIMIT)
#if EITHER(SLOWDOWN, ULTRA_LCD) || defined(XY_FREQUENCY_LIMIT)
// Segment time im micro seconds
uint32_t segment_time_us = LROUND(1000000.0f / inverse_secs);
#endif
@ -2172,7 +2172,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
// Calculate and limit speed in mm/sec for each axis
float current_speed[NUM_AXIS], speed_factor = 1.0f; // factor <1 decreases speed
LOOP_XYZE(i) {
#if ENABLED(MIXING_EXTRUDER) && ENABLED(RETRACT_SYNC_MIXING)
#if BOTH(MIXING_EXTRUDER, RETRACT_SYNC_MIXING)
// In worst case, only one extruder running, no change is needed.
// In best case, all extruders run the same amount, we can divide by MIXING_STEPPERS
float delta_mm_i = 0;
@ -2485,7 +2485,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
float safe_speed = nominal_speed;
uint8_t limited = 0;
#if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE)
#if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE)
LOOP_XYZ(i)
#else
LOOP_XYZE(i)
@ -2522,7 +2522,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
// Now limit the jerk in all axes.
const float smaller_speed_factor = vmax_junction / previous_nominal_speed;
#if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE)
#if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE)
LOOP_XYZ(axis)
#else
LOOP_XYZE(axis)
@ -2893,7 +2893,7 @@ void Planner::reset_acceleration_rates() {
if (AXIS_CONDITION) NOLESS(highest_rate, max_acceleration_steps_per_s2[i]);
}
cutoff_long = 4294967295UL / highest_rate; // 0xFFFFFFFFUL
#if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE)
#if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE)
recalculate_max_e_jerk();
#endif
}

View File

@ -159,7 +159,7 @@ typedef struct block_t {
} block_t;
#define HAS_POSITION_FLOAT (ENABLED(LIN_ADVANCE) || ENABLED(SCARA_FEEDRATE_SCALING) || ENABLED(GRADIENT_MIX))
#define HAS_POSITION_FLOAT ANY(LIN_ADVANCE, SCARA_FEEDRATE_SCALING, GRADIENT_MIX)
#define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1))
@ -253,7 +253,7 @@ class Planner {
#if HAS_CLASSIC_JERK
static float max_jerk[
#if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE)
#if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE)
XYZ // (mm/s^2) M205 XYZ - The largest speed change requiring no acceleration.
#else
XYZE // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration.
@ -861,7 +861,7 @@ class Planner {
static void autotemp_M104_M109();
#endif
#if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE)
#if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE)
FORCE_INLINE static void recalculate_max_e_jerk() {
#define GET_MAX_E_JERK(N) SQRT(SQRT(0.5) * junction_deviation_mm * (N) * RECIPROCAL(1.0 - SQRT(0.5)))
#if ENABLED(DISTINCT_E_FACTORS)

View File

@ -28,7 +28,7 @@
// Print debug messages with M111 S2
//#define DEBUG_PRINTCOUNTER
#if ENABLED(I2C_EEPROM) || ENABLED(SPI_EEPROM)
#if EITHER(I2C_EEPROM, SPI_EEPROM)
// round up address to next page boundary (assuming 32 byte pages)
#define STATS_EEPROM_ADDRESS 0x40
#else
@ -57,7 +57,7 @@ class PrintCounter: public Stopwatch {
private:
typedef Stopwatch super;
#if ENABLED(I2C_EEPROM) || ENABLED(SPI_EEPROM) || defined(CPU_32_BIT)
#if EITHER(I2C_EEPROM, SPI_EEPROM) || defined(CPU_32_BIT)
typedef uint32_t eeprom_address_t;
#else
typedef uint16_t eeprom_address_t;

View File

@ -38,7 +38,7 @@
#include "../gcode/gcode.h"
#include "../lcd/ultralcd.h"
#if ENABLED(BLTOUCH) || ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(PROBE_TRIGGERED_WHEN_STOWED_TEST) || (QUIET_PROBING && ENABLED(PROBING_STEPPERS_OFF))
#if ANY(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY, PROBE_TRIGGERED_WHEN_STOWED_TEST) || (QUIET_PROBING && ENABLED(PROBING_STEPPERS_OFF))
#include "../Marlin.h" // for stop(), disable_e_steppers
#endif
@ -416,7 +416,7 @@ bool set_probe_deployed(const bool deploy) {
if (deploy_stow_condition && unknown_condition)
do_probe_raise(MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_CLEARANCE_DEPLOY_PROBE));
#if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY)
#if EITHER(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY)
#if ENABLED(Z_PROBE_SLED)
#define _AUE_ARGS true, false, false
#else
@ -553,7 +553,7 @@ static bool do_probe_move(const float z, const float fr_mm_s) {
// Check to see if the probe was triggered
const bool probe_triggered =
#if ENABLED(DELTA) && ENABLED(SENSORLESS_PROBING)
#if BOTH(DELTA, SENSORLESS_PROBING)
endstops.trigger_state() & (_BV(X_MIN) | _BV(Y_MIN) | _BV(Z_MIN))
#else
TEST(endstops.trigger_state(),

View File

@ -153,7 +153,7 @@ bool Stepper::abort_current_block;
#if Z_MULTI_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN)
bool Stepper::locked_Z_motor = false, Stepper::locked_Z2_motor = false;
#endif
#if ENABLED(Z_TRIPLE_ENDSTOPS) || (ENABLED(Z_STEPPER_AUTO_ALIGN) && ENABLED(Z_TRIPLE_STEPPER_DRIVERS))
#if ENABLED(Z_TRIPLE_ENDSTOPS) || BOTH(Z_STEPPER_AUTO_ALIGN, Z_TRIPLE_STEPPER_DRIVERS)
bool Stepper::locked_Z3_motor = false;
#endif
@ -1450,7 +1450,7 @@ void Stepper::stepper_pulse_phase_isr() {
// Pulse Extruders
// Tick the E axis, correct error term and update position
#if ENABLED(LIN_ADVANCE) || ENABLED(MIXING_EXTRUDER)
#if EITHER(LIN_ADVANCE, MIXING_EXTRUDER)
delta_error[E_AXIS] += advance_dividend[E_AXIS];
if (delta_error[E_AXIS] >= 0) {
count_position[E_AXIS] += count_direction[E_AXIS];
@ -1679,7 +1679,7 @@ uint32_t Stepper::stepper_block_phase_isr() {
* If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z, handled below)
* If DeltaA == DeltaB, the movement is only in the 1st axis (X)
*/
#if ENABLED(COREXY) || ENABLED(COREXZ)
#if EITHER(COREXY, COREXZ)
#define X_CMP ==
#else
#define X_CMP !=
@ -1697,7 +1697,7 @@ uint32_t Stepper::stepper_block_phase_isr() {
* If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y)
* If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z)
*/
#if ENABLED(COREYX) || ENABLED(COREYZ)
#if EITHER(COREYX, COREYZ)
#define Y_CMP ==
#else
#define Y_CMP !=
@ -1715,7 +1715,7 @@ uint32_t Stepper::stepper_block_phase_isr() {
* If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y, already handled above)
* If DeltaA == -DeltaB, the movement is only in the 2nd axis (Z)
*/
#if ENABLED(COREZX) || ENABLED(COREZY)
#if EITHER(COREZX, COREZY)
#define Z_CMP ==
#else
#define Z_CMP !=
@ -2030,7 +2030,7 @@ void Stepper::init() {
#if HAS_X_ENABLE
X_ENABLE_INIT;
if (!X_ENABLE_ON) X_ENABLE_WRITE(HIGH);
#if (ENABLED(DUAL_X_CARRIAGE) || ENABLED(X_DUAL_STEPPER_DRIVERS)) && HAS_X2_ENABLE
#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) && HAS_X2_ENABLE
X2_ENABLE_INIT;
if (!X_ENABLE_ON) X2_ENABLE_WRITE(HIGH);
#endif
@ -2093,7 +2093,7 @@ void Stepper::init() {
// Init Step Pins
#if HAS_X_STEP
#if ENABLED(X_DUAL_STEPPER_DRIVERS) || ENABLED(DUAL_X_CARRIAGE)
#if EITHER(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE)
X2_STEP_INIT;
X2_STEP_WRITE(INVERT_X_STEP_PIN);
#endif
@ -2467,13 +2467,13 @@ void Stepper::report_positions() {
if (!initialized) return;
LOOP_L_N(i, COUNT(motor_current_setting)) {
switch (i) {
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_X) || PIN_EXISTS(MOTOR_CURRENT_PWM_Y)
#if ANY_PIN(MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y)
case 0:
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
case 1:
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E) || PIN_EXISTS(MOTOR_CURRENT_PWM_E0) || PIN_EXISTS(MOTOR_CURRENT_PWM_E1)
#if ANY_PIN(MOTOR_CURRENT_PWM_E, MOTOR_CURRENT_PWM_E0, MOTOR_CURRENT_PWM_E1)
case 2:
#endif
digipot_current(i, motor_current_setting[i]);

View File

@ -267,7 +267,7 @@ class Stepper {
#if Z_MULTI_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN)
static bool locked_Z_motor, locked_Z2_motor;
#endif
#if ENABLED(Z_TRIPLE_ENDSTOPS) || (ENABLED(Z_STEPPER_AUTO_ALIGN) && ENABLED(Z_TRIPLE_STEPPER_DRIVERS))
#if ENABLED(Z_TRIPLE_ENDSTOPS) || BOTH(Z_STEPPER_AUTO_ALIGN, Z_TRIPLE_STEPPER_DRIVERS)
static bool locked_Z3_motor;
#endif
@ -423,7 +423,7 @@ class Stepper {
FORCE_INLINE static void set_z_lock(const bool state) { locked_Z_motor = state; }
FORCE_INLINE static void set_z2_lock(const bool state) { locked_Z2_motor = state; }
#endif
#if ENABLED(Z_TRIPLE_ENDSTOPS) || (ENABLED(Z_STEPPER_AUTO_ALIGN) && ENABLED(Z_TRIPLE_STEPPER_DRIVERS))
#if ENABLED(Z_TRIPLE_ENDSTOPS) || BOTH(Z_STEPPER_AUTO_ALIGN, Z_TRIPLE_STEPPER_DRIVERS)
FORCE_INLINE static void set_z3_lock(const bool state) { locked_Z3_motor = state; }
#endif

View File

@ -618,7 +618,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#define _REV_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE( INVERT_E0_DIR); } else { E1_DIR_WRITE( INVERT_E1_DIR); } }while(0)
#endif
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(MULTI_NOZZLE_DUPLICATION)
#if EITHER(DUAL_X_CARRIAGE, MULTI_NOZZLE_DUPLICATION)
#define NDIR(N) _DUPE(DIR,!INVERT_E##N##_DIR)
#define RDIR(N) _DUPE(DIR, INVERT_E##N##_DIR)

View File

@ -33,13 +33,13 @@
#include "../core/language.h"
#include "../HAL/shared/Delay.h"
#define MAX6675_SEPARATE_SPI (ENABLED(HEATER_0_USES_MAX6675) || ENABLED(HEATER_1_USES_MAX6675)) && PIN_EXISTS(MAX6675_SCK) && PIN_EXISTS(MAX6675_DO)
#define MAX6675_SEPARATE_SPI EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) && PIN_EXISTS(MAX6675_SCK, MAX6675_DO)
#if MAX6675_SEPARATE_SPI
#include "../libs/private_spi.h"
#endif
#if ENABLED(BABYSTEPPING) || ENABLED(PID_EXTRUSION_SCALING)
#if EITHER(BABYSTEPPING, PID_EXTRUSION_SCALING)
#include "stepper.h"
#endif
@ -360,8 +360,8 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0
#endif
#if WATCH_BED || WATCH_HOTENDS
#define HAS_TP_BED (ENABLED(THERMAL_PROTECTION_BED) && ENABLED(PIDTEMPBED))
#if HAS_TP_BED && ENABLED(THERMAL_PROTECTION_HOTENDS) && ENABLED(PIDTEMP)
#define HAS_TP_BED BOTH(THERMAL_PROTECTION_BED, PIDTEMPBED)
#if HAS_TP_BED && BOTH(THERMAL_PROTECTION_HOTENDS, PIDTEMP)
#define GTV(B,H) (heater < 0 ? (B) : (H))
#elif HAS_TP_BED
#define GTV(B,H) (B)
@ -913,7 +913,7 @@ void Temperature::manage_heater() {
}
#endif
#if ENABLED(PROBING_HEATERS_OFF) && ENABLED(BED_LIMIT_SWITCHING)
#if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING)
static bool last_pause_state;
#endif
@ -1004,12 +1004,12 @@ void Temperature::manage_heater() {
#if DISABLED(PIDTEMPBED)
if (PENDING(ms, next_bed_check_ms)
#if ENABLED(PROBING_HEATERS_OFF) && ENABLED(BED_LIMIT_SWITCHING)
#if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING)
&& paused == last_pause_state
#endif
) return;
next_bed_check_ms = ms + BED_CHECK_INTERVAL;
#if ENABLED(PROBING_HEATERS_OFF) && ENABLED(BED_LIMIT_SWITCHING)
#if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING)
last_pause_state = paused;
#endif
#endif
@ -1334,7 +1334,7 @@ void Temperature::init() {
#endif
#if MB(RUMBA)
#define _AD(N) (ENABLED(HEATER_##N##_USES_AD595) || ENABLED(HEATER_##N##_USES_AD8495))
#define _AD(N) (ANY(HEATER_##N##_USES_AD595, HEATER_##N##_USES_AD8495))
#if _AD(0) || _AD(1) || _AD(2) || _AD(3) || _AD(4) || _AD(5) || _AD(BED) || _AD(CHAMBER)
// Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector
MCUCR = _BV(JTD);
@ -1342,7 +1342,7 @@ void Temperature::init() {
#endif
#endif
#if ENABLED(PIDTEMP) && ENABLED(PID_EXTRUSION_SCALING)
#if BOTH(PIDTEMP, PID_EXTRUSION_SCALING)
last_e_position = 0;
#endif
@ -2743,7 +2743,7 @@ void Temperature::isr() {
//
#if ENABLED(BABYSTEPPING)
#if ENABLED(BABYSTEP_XY) || ENABLED(I2C_POSITION_ENCODERS)
#if EITHER(BABYSTEP_XY, I2C_POSITION_ENCODERS)
LOOP_XYZ(axis) {
const int16_t curTodo = babystepsTodo[axis]; // get rid of volatile for performance
if (curTodo) {
@ -2942,7 +2942,7 @@ void Temperature::isr() {
#endif // AUTO_REPORT_TEMPERATURES
#if ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI)
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
void Temperature::set_heating_message(const uint8_t e) {
const bool heating = isHeatingHotend(e);
#if HOTENDS > 1

View File

@ -739,7 +739,7 @@ class Temperature {
#endif
#endif
#if ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI)
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
static void set_heating_message(const uint8_t e);
#endif
@ -778,9 +778,9 @@ class Temperature {
static void updateTemperaturesFromRawValues();
#define HAS_MAX6675 (ENABLED(HEATER_0_USES_MAX6675) || ENABLED(HEATER_1_USES_MAX6675))
#define HAS_MAX6675 EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675)
#if HAS_MAX6675
#if ENABLED(HEATER_0_USES_MAX6675) && ENABLED(HEATER_1_USES_MAX6675)
#if BOTH(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675)
#define COUNT_6675 2
#else
#define COUNT_6675 1

View File

@ -49,7 +49,7 @@
#include "../gcode/gcode.h" // for dwell()
#endif
#if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE) || ENABLED(SWITCHING_TOOLHEAD)
#if ANY(SWITCHING_EXTRUDER, SWITCHING_NOZZLE, SWITCHING_TOOLHEAD)
#include "servo.h"
#endif
@ -740,7 +740,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
singlenozzle_temp[active_extruder] = thermalManager.temp_hotend[0].target;
if (singlenozzle_temp[tmp_extruder] && singlenozzle_temp[tmp_extruder] != singlenozzle_temp[active_extruder]) {
thermalManager.setTargetHotend(singlenozzle_temp[tmp_extruder], 0);
#if ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI)
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
thermalManager.set_heating_message(0);
#endif
(void)thermalManager.wait_for_hotend(0, false); // Wait for heating or cooling

View File

@ -874,7 +874,7 @@
#define _EPIN(p,q) __EPIN(p,q)
// The X2 axis, if any, should be the next open extruder port
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(X_DUAL_STEPPER_DRIVERS)
#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
#ifndef X2_STEP_PIN
#define X2_STEP_PIN _EPIN(E_STEPPERS, STEP)
#define X2_DIR_PIN _EPIN(E_STEPPERS, DIR)

View File

@ -75,7 +75,7 @@
//
// LCD / Controller
//
#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
#if BOTH(ULTRA_LCD, NEWPANEL)
#undef BEEPER_PIN
#undef LCD_PINS_RS
@ -154,7 +154,7 @@
#define SPINDLE_LASER_PWM_PIN 46 // MUST BE HARDWARE PWM
#define SPINDLE_LASER_ENABLE_PIN 62 // Pin should have a pullup!
#define SPINDLE_DIR_PIN 48
#elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // use expansion header if no LCD in use
#elif !BOTH(ULTRA_LCD, NEWPANEL) // use expansion header if no LCD in use
#define SPINDLE_LASER_ENABLE_PIN 16 // Pin should have a pullup/pulldown!
#define SPINDLE_DIR_PIN 17
#endif

View File

@ -162,7 +162,7 @@
#define LCD_PINS_D6 16
#define LCD_PINS_D7 17
#define ADC_KEYPAD_PIN 1
#elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(ANET_FULL_GRAPHICS_LCD)
#elif EITHER(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, ANET_FULL_GRAPHICS_LCD)
// Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics
// display using an adapter board // https://go.aisler.net/benlye/anet-lcd-adapter/pcb
// See below for alternative pin definitions for use with https://www.thingiverse.com/thing:2103748

View File

@ -53,7 +53,7 @@
#undef STAT_LED_RED_PIN
#undef STAT_LED_BLUE_PIN
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
#if ANY(VIKI2, miniVIKI)
#undef DOGLCD_A0
#undef DOGLCD_CS
@ -75,7 +75,7 @@
//
// Misc
//
#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && PIN_EXISTS(STAT_LED_RED) && STAT_LED_RED_PIN == CASE_LIGHT_PIN
#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT, STAT_LED_RED) && STAT_LED_RED_PIN == CASE_LIGHT_PIN
#undef STAT_LED_RED_PIN
#endif

View File

@ -139,7 +139,7 @@
#undef BEEPER_PIN
#define BEEPER_PIN 33
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
#if ANY(VIKI2, miniVIKI)
#undef SD_DETECT_PIN
#define SD_DETECT_PIN 49 // For easy adapter board
#undef BEEPER_PIN
@ -166,7 +166,7 @@
#undef SPINDLE_DIR_PIN
#if ENABLED(SPINDLE_LASER_ENABLE) // EXP2 header
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
#if ANY(VIKI2, miniVIKI)
#undef BTN_EN2
#define BTN_EN2 31 // need 7 for the spindle speed PWM
#endif

View File

@ -112,7 +112,7 @@
// Display
//
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
#if ANY(VIKI2, miniVIKI)
#define BEEPER_PIN P1_31
#define DOGLCD_A0 P2_06
#define DOGLCD_CS P0_16

View File

@ -143,7 +143,7 @@
//#define SHIFT_EN P1_22 // (41) J5-4 & AUX-4
#endif
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
#if ANY(VIKI2, miniVIKI)
//#define LCD_SCREEN_ROT_180
#define BEEPER_PIN P1_30 // (37) may change if cable changes

View File

@ -126,7 +126,7 @@
#define LCD_PINS_RS 49 // CS chip select /SS chip slave select
#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 PB8
#define LCD_PINS_ENABLE PD2
#define LCD_PINS_D4 PB12
@ -193,7 +193,7 @@
#define LCD_SDSS 53
#define SD_DETECT_PIN 49
#elif ENABLED(VIKI2) || ENABLED(miniVIKI)
#elif ANY(VIKI2, miniVIKI)
#define BEEPER_PIN 33

View File

@ -125,7 +125,7 @@
#define LCD_PINS_RS 49 // CS chip select /SS chip slave select
#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 PB8
#define LCD_PINS_ENABLE PD2
#define LCD_PINS_D4 PB12
@ -192,7 +192,7 @@
#define LCD_SDSS 53
#define SD_DETECT_PIN 49
#elif ENABLED(VIKI2) || ENABLED(miniVIKI)
#elif ANY(VIKI2, miniVIKI)
#define BEEPER_PIN 33

View File

@ -49,7 +49,7 @@
//
// LCD / Controller
//
#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
#if BOTH(ULTRA_LCD, NEWPANEL)
#define SD_DETECT_PIN 6

View File

@ -35,9 +35,7 @@
#define FIL_RUNOUT_PIN 22
#endif
#define GREEDY_PANEL ( ENABLED(PANEL_ONE) || ENABLED(VIKI2) \
|| ENABLED(miniVIKI) || ENABLED(MINIPANEL) \
|| ENABLED(REPRAPWORLD_KEYPAD) )
#define GREEDY_PANEL ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD)
//
// M3/M4/M5 - Spindle/Laser Control

View File

@ -104,7 +104,7 @@
//
#define BEEPER_PIN 33
#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
#if BOTH(ULTRA_LCD, NEWPANEL)
#define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 17

View File

@ -175,9 +175,9 @@
#endif
#ifndef FAN_PIN
#if ENABLED(IS_EFB) || ENABLED(IS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan
#if EITHER(IS_EFB, IS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan
#define FAN_PIN EX2_HEAT_PIN
#elif ENABLED(IS_EEF) || ENABLED(IS_SF) // Hotend, Hotend, Fan or Spindle, Fan
#elif EITHER(IS_EEF, IS_SF) // Hotend, Hotend, Fan or Spindle, Fan
#define FAN_PIN HBP_PIN
#else
#define FAN_PIN EXTRA_FET_PIN

View File

@ -56,7 +56,7 @@
//
// LCD / Controller
//
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
#if ANY(VIKI2, miniVIKI)
/**
* VIKI2 Has two groups of wires with...
*

View File

@ -245,7 +245,7 @@
#define LCD_SDSS P0_28 // EXP2.4
#define LCD_PINS_ENABLE P0_18 // EXP1.3
#define LCD_PINS_D4 P0_15 // EXP1.5
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
#if ANY(VIKI2, miniVIKI)
#define DOGLCD_SCK SCK_PIN
#define DOGLCD_MOSI MOSI_PIN
#endif

View File

@ -123,7 +123,7 @@
//
// LCD / Controller
//
#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
#if BOTH(ULTRA_LCD, NEWPANEL)
#define LCD_PINS_RS 9 // E1 JP11-11
#define LCD_PINS_ENABLE 8 // E0 JP11-10
@ -132,7 +132,7 @@
#define LCD_PINS_D6 5 // D5 JP11-6
#define LCD_PINS_D7 4 // D4 JP11-5
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
#if ANY(VIKI2, miniVIKI)
#define BEEPER_PIN 8 // E0 JP11-10
#define DOGLCD_A0 40 // F2 JP2-2

View File

@ -208,7 +208,7 @@
#define LCD_PINS_D6 5 // D5 JP11-6
#define LCD_PINS_D7 4 // D4 JP11-5
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
#if ANY(VIKI2, miniVIKI)
#define BEEPER_PIN 8 // E0 JP11-10
#define DOGLCD_A0 40 // F2 JP2-2

View File

@ -175,7 +175,7 @@
#define LCD_PINS_D6 74
#define LCD_PINS_D7 75
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
#if ANY(VIKI2, miniVIKI)
#define BEEPER_PIN 44
// NB: Panucatt's Viki 2.0 wiring diagram (v1.2) indicates that the
// beeper/buzzer is connected to pin 33; however, the pin used in the

View File

@ -199,9 +199,9 @@
#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
@ -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

View File

@ -76,7 +76,7 @@
//
#if ENABLED(ULTRA_LCD)
#if ENABLED(NEWPANEL) && ENABLED(PANEL_ONE)
#if BOTH(NEWPANEL, PANEL_ONE)
#undef LCD_PINS_D4
#define LCD_PINS_D4 68

View File

@ -161,7 +161,7 @@
#define DOGLCD_A0 27
#endif
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
#if ANY(VIKI2, miniVIKI)
#define DOGLCD_A0 16
#define KILL_PIN 51
#define STAT_LED_BLUE_PIN 29

View File

@ -220,8 +220,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
@ -234,8 +233,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
@ -335,7 +333,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
@ -367,7 +365,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
@ -451,7 +449,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

View File

@ -73,7 +73,7 @@
#undef E0_CS_PIN
#undef E1_CS_PIN
#if ENABLED(ULTRA_LCD) && DISABLED(REPRAPWORLD_GRAPHICAL_LCD) && (DISABLED(NEWPANEL) || DISABLED(PANEL_ONE)) && DISABLED(CR10_STOCKDISPLAY)
#if ENABLED(ULTRA_LCD) && DISABLED(REPRAPWORLD_GRAPHICAL_LCD) && !BOTH(NEWPANEL, PANEL_ONE) && DISABLED(CR10_STOCKDISPLAY)
#if DISABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)
#undef LCD_PINS_RS
#define LCD_PINS_RS 42 // 3DYMY boards pin 16 -> 42

View File

@ -173,9 +173,9 @@
#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 P1_18 // (4) IO pin. Buffer needed
@ -293,7 +293,7 @@
//#define SHIFT_EN P1_22 // (41) J5-4 & AUX-4
#endif
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
#if ANY(VIKI2, miniVIKI)
// #define LCD_SCREEN_ROT_180
#define BTN_EN1 P3_26 // (31) J3-2 & AUX-4

View File

@ -167,7 +167,7 @@
//
// LCD / Controller
//
#if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)
#if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
#define LCD_PINS_DC 38 // Set as output on init
#define LCD_PINS_RS 41 // Pull low for 1s to init
// DOGM SPI LCD Support

View File

@ -202,7 +202,7 @@
//
#if ENABLED(ULTRA_LCD)
#if ENABLED(RADDS_DISPLAY) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
#if EITHER(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER)
#define BEEPER_PIN 62

Some files were not shown because too many files have changed in this diff Show More