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:
@ -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();
|
||||
|
Reference in New Issue
Block a user