From f790b4bc0a36fa36e77087cda46f5fb593500af2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 27 Apr 2018 00:44:47 -0500 Subject: [PATCH] Reorganize some conditionals --- Marlin/src/inc/Conditionals_LCD.h | 16 ++++++++++------ Marlin/src/inc/Conditionals_post.h | 27 +++++---------------------- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index e00a12cd4c..c1467c24a6 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -500,18 +500,22 @@ #define HAS_Z_SERVO_PROBE (defined(Z_PROBE_SERVO_NR) && Z_PROBE_SERVO_NR >= 0) /** - * Set a flag for any enabled probe + * Set flags for enabled probes */ -#define PROBE_SELECTED (ENABLED(PROBE_MANUALLY) || ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_PROBE || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE)) +#define HAS_BED_PROBE (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_PROBE || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE)) +#define PROBE_SELECTED (HAS_BED_PROBE || ENABLED(PROBE_MANUALLY)) -/** - * Clear probe pin settings when no probe is selected - */ -#if !PROBE_SELECTED || ENABLED(PROBE_MANUALLY) +#if !HAS_BED_PROBE + // Clear probe pin settings when no probe is selected #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN #undef Z_MIN_PROBE_ENDSTOP +#elif ENABLED(Z_PROBE_ALLEN_KEY) + // Extra test for Allen Key Probe + #define PROBE_IS_TRIGGERED_WHEN_STOWED_TEST #endif +#define HOMING_Z_WITH_PROBE (HAS_BED_PROBE && Z_HOME_DIR < 0 && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) + #define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS)) #define HAS_RESUME_CONTINUE (ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER)) #define HAS_COLOR_LEDS (ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED)) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 7b8e2aaf74..d6b806718f 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -166,11 +166,6 @@ #define DELTA_HEIGHT Z_HOME_POS #endif -/** - * Auto Bed Leveling and Z Probe Repeatability Test - */ -#define HOMING_Z_WITH_PROBE (HAS_BED_PROBE && Z_HOME_DIR < 0 && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) - /** * Z Sled Probe requires Z_SAFE_HOMING */ @@ -814,11 +809,15 @@ #define HAS_CONTROLLER_FAN (PIN_EXISTS(CONTROLLER_FAN)) // Servos -#define HAS_SERVOS (defined(NUM_SERVOS) && NUM_SERVOS > 0) #define HAS_SERVO_0 (PIN_EXISTS(SERVO0)) #define HAS_SERVO_1 (PIN_EXISTS(SERVO1)) #define HAS_SERVO_2 (PIN_EXISTS(SERVO2)) #define HAS_SERVO_3 (PIN_EXISTS(SERVO3)) +#define HAS_SERVOS (defined(NUM_SERVOS) && NUM_SERVOS > 0) + +#if HAS_SERVOS && !defined(Z_PROBE_SERVO_NR) + #define Z_PROBE_SERVO_NR -1 +#endif // Sensors #define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH)) @@ -941,22 +940,6 @@ */ #define HAS_FANMUX PIN_EXISTS(FANMUX0) -/** - * Servos and probes - */ - -#if HAS_SERVOS - #ifndef Z_PROBE_SERVO_NR - #define Z_PROBE_SERVO_NR -1 - #endif -#endif - -#define HAS_BED_PROBE (PROBE_SELECTED && DISABLED(PROBE_MANUALLY)) - -#if ENABLED(Z_PROBE_ALLEN_KEY) - #define PROBE_IS_TRIGGERED_WHEN_STOWED_TEST -#endif - /** * Bed Probe dependencies */