From eaf1c0954eff9a8a6473a8853a47478a4a6cb73b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 14 Jul 2019 08:56:29 -0500 Subject: [PATCH] Update some precompiler tests --- Marlin/src/core/language.h | 18 +++++++++--------- Marlin/src/gcode/config/M200-M205.cpp | 2 +- Marlin/src/gcode/config/M92.cpp | 2 +- Marlin/src/inc/SanityCheck.h | 18 ++++++++---------- Marlin/src/lcd/menu/menu_advanced.cpp | 2 +- Marlin/src/module/configuration_store.cpp | 6 +++--- Marlin/src/module/temperature.cpp | 4 +--- Marlin/src/module/temperature.h | 6 ++++-- 8 files changed, 28 insertions(+), 30 deletions(-) diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index c291b0549a..a5131d6fad 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -367,15 +367,15 @@ #include INCLUDE_LANGUAGE -#if DISABLED(DISPLAY_CHARSET_ISO10646_1) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_5) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_KANA) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_GREEK) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_CN) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_TR) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_PL) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_CZ) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_SK) +#if NONE(DISPLAY_CHARSET_ISO10646_1, \ + DISPLAY_CHARSET_ISO10646_5, \ + DISPLAY_CHARSET_ISO10646_KANA, \ + DISPLAY_CHARSET_ISO10646_GREEK, \ + DISPLAY_CHARSET_ISO10646_CN, \ + DISPLAY_CHARSET_ISO10646_TR, \ + DISPLAY_CHARSET_ISO10646_PL, \ + DISPLAY_CHARSET_ISO10646_CZ, \ + DISPLAY_CHARSET_ISO10646_SK) #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. #endif diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index 8ae8e58d2e..3e96641474 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -161,7 +161,7 @@ void GcodeSuite::M205() { SERIAL_ECHOLNPGM("WARNING! Low Z Jerk may lead to unwanted pauses."); #endif } - #if DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE) + #if !BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) if (parser.seen('E')) planner.max_jerk[E_AXIS] = parser.value_linear_units(); #endif #endif diff --git a/Marlin/src/gcode/config/M92.cpp b/Marlin/src/gcode/config/M92.cpp index dc4b134af7..3965136e6b 100644 --- a/Marlin/src/gcode/config/M92.cpp +++ b/Marlin/src/gcode/config/M92.cpp @@ -76,7 +76,7 @@ void GcodeSuite::M92() { const float value = parser.value_per_axis_units((AxisEnum)(E_AXIS_N(target_extruder))); if (value < 20) { float factor = planner.settings.axis_steps_per_mm[E_AXIS_N(target_extruder)] / value; // increase e constants if M92 E14 is given for netfab. - #if HAS_CLASSIC_JERK && (DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE)) + #if HAS_CLASSIC_JERK && !BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) planner.max_jerk[E_AXIS] *= factor; #endif planner.settings.max_feedrate_mm_s[E_AXIS_N(target_extruder)] *= factor; diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 0c3b853cd0..9b970ff0ed 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -494,14 +494,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif -#if !defined(TARGET_LPC1768) && ( \ - ENABLED(ENDSTOPPULLDOWNS) \ - || ENABLED(ENDSTOPPULLDOWN_XMAX) \ - || ENABLED(ENDSTOPPULLDOWN_YMAX) \ - || ENABLED(ENDSTOPPULLDOWN_ZMAX) \ - || ENABLED(ENDSTOPPULLDOWN_XMIN) \ - || ENABLED(ENDSTOPPULLDOWN_YMIN) \ - || ENABLED(ENDSTOPPULLDOWN_ZMIN) ) +#if !defined(TARGET_LPC1768) && ANY( \ + ENDSTOPPULLDOWNS, \ + ENDSTOPPULLDOWN_XMAX, ENDSTOPPULLDOWN_YMAX, \ + ENDSTOPPULLDOWN_ZMAX, ENDSTOPPULLDOWN_XMIN, \ + ENDSTOPPULLDOWN_YMIN, ENDSTOPPULLDOWN_ZMIN \ + ) #error "PULLDOWN pin mode is not available on the selected board." #endif @@ -602,7 +600,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * I2C Position Encoders */ #if ENABLED(I2C_POSITION_ENCODERS) - #if DISABLED(BABYSTEPPING) || DISABLED(BABYSTEP_XY) + #if !BOTH(BABYSTEPPING, BABYSTEP_XY) #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY." #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5) #error "I2CPE_ENCODER_CNT must be between 1 and 5." @@ -1256,7 +1254,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL." #endif -#if ENABLED(MESH_EDIT_GFX_OVERLAY) && (DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(DOGLCD)) +#if ENABLED(MESH_EDIT_GFX_OVERLAY) && !BOTH(AUTO_BED_LEVELING_UBL, DOGLCD) #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD." #endif diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 2dc865c3b4..822616c401 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -554,7 +554,7 @@ void menu_backlash(); #else MENU_MULTIPLIER_ITEM_EDIT(float52sign, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 0.1f, 990); #endif - #if DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE) + #if !BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) EDIT_JERK(E); #endif #endif diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index dd3565de14..33e00cf79b 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -2252,7 +2252,7 @@ void MarlinSettings::reset() { planner.max_jerk[X_AXIS] = DEFAULT_XJERK; planner.max_jerk[Y_AXIS] = DEFAULT_YJERK; planner.max_jerk[Z_AXIS] = DEFAULT_ZJERK; - #if DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE) + #if !BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) planner.max_jerk[E_AXIS] = DEFAULT_EJERK; #endif #endif @@ -2768,7 +2768,7 @@ void MarlinSettings::reset() { #endif #if HAS_CLASSIC_JERK SERIAL_ECHOPGM(" X Y Z"); - #if DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE) + #if !BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) SERIAL_ECHOPGM(" E"); #endif #endif @@ -2786,7 +2786,7 @@ void MarlinSettings::reset() { , " X", LINEAR_UNIT(planner.max_jerk[X_AXIS]) , " Y", LINEAR_UNIT(planner.max_jerk[Y_AXIS]) , " Z", LINEAR_UNIT(planner.max_jerk[Z_AXIS]) - #if DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE) + #if !BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) , " E", LINEAR_UNIT(planner.max_jerk[E_AXIS]) #endif #endif diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index b6d35b9534..cf489abc4d 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1005,8 +1005,6 @@ void Temperature::manage_heater() { if (temp_hotend[1].current < _MAX(HEATER_1_MINTEMP, HEATER_1_MAX6675_TMIN + .01)) min_temp_error(H_E1); #endif - #define HAS_THERMAL_PROTECTION (ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED || ENABLED(THERMAL_PROTECTION_CHAMBER)) - #if HAS_THERMAL_PROTECTION || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN || HEATER_IDLE_HANDLER millis_t ms = millis(); #endif @@ -1933,7 +1931,7 @@ void Temperature::init() { } } -#endif // THERMAL_PROTECTION_HOTENDS || THERMAL_PROTECTION_BED || ENABLED(THERMAL_PROTECTION_CHAMBER) +#endif // HAS_THERMAL_PROTECTION void Temperature::disable_all_heaters() { diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index f19b1a4f17..8c69e13169 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -828,7 +828,9 @@ class Temperature { static void min_temp_error(const heater_ind_t e); static void max_temp_error(const heater_ind_t e); - #if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED || ENABLED(THERMAL_PROTECTION_CHAMBER) + #define HAS_THERMAL_PROTECTION (EITHER(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_CHAMBER) || HAS_THERMALLY_PROTECTED_BED) + + #if HAS_THERMAL_PROTECTION enum TRState : char { TRInactive, TRFirstHeating, TRStable, TRRunaway }; @@ -849,7 +851,7 @@ class Temperature { static void thermal_runaway_protection(tr_state_machine_t &state, const float ¤t, const float &target, const heater_ind_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc); - #endif // THERMAL_PROTECTION + #endif // HAS_THERMAL_PROTECTION }; extern Temperature thermalManager;