Reorganize some conditionals

This commit is contained in:
Scott Lahteine 2018-04-27 00:44:47 -05:00
parent a51ba6e3f6
commit f790b4bc0a
2 changed files with 15 additions and 28 deletions

View File

@ -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))

View File

@ -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
*/