Merge pull request #4398 from thinkyhead/rc_z_safe_sanity

Sanity checks for Z_SAFE_HOMING
This commit is contained in:
Scott Lahteine 2016-07-24 12:21:10 -07:00 committed by GitHub
commit 450fe8134d
2 changed files with 18 additions and 7 deletions

View File

@ -388,13 +388,11 @@
*/
#define HAS_PROBING_PROCEDURE (ENABLED(AUTO_BED_LEVELING_FEATURE) || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST))
#if HAS_PROBING_PROCEDURE
// Boundaries for probing based on set limits
#define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
#define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
#define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
#define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
#endif
#define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0)

View File

@ -353,10 +353,23 @@
#error "AUTO_BED_LEVELING_FEATURE requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE."
#elif ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
#error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE."
#elif ENABLED(Z_SAFE_HOMING)
#error "Z_SAFE_HOMING currently requires a probe."
#endif
#endif
/**
* Make sure Z_SAFE_HOMING point is reachable
*/
#if ENABLED(Z_SAFE_HOMING)
#if Z_SAFE_HOMING_X_POINT < MIN_PROBE_X || Z_SAFE_HOMING_X_POINT > MAX_PROBE_X
#error "The given Z_SAFE_HOMING_X_POINT can't be reached by the Z probe."
#elif Z_SAFE_HOMING_Y_POINT < MIN_PROBE_Y || Z_SAFE_HOMING_Y_POINT > MAX_PROBE_Y
#error "The given Z_SAFE_HOMING_Y_POINT can't be reached by the Z probe."
#endif
#endif // Z_SAFE_HOMING
/**
* Auto Bed Leveling
*/