From 79835590e3009487d606c7de8de6a7e07095ea6b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 6 Aug 2018 23:11:37 -0500 Subject: [PATCH] Easier to disable homing validation (#11458) --- Marlin/src/module/endstops.cpp | 12 +++++++----- Marlin/src/module/endstops.h | 10 ++++++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index cecd30353..68886eb84 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -256,11 +256,13 @@ void Endstops::not_homing() { #endif } -// If the last move failed to trigger an endstop, call kill -void Endstops::validate_homing_move() { - if (trigger_state()) hit_on_purpose(); - else kill(PSTR(MSG_ERR_HOMING_FAILED)); -} +#if ENABLED(VALIDATE_HOMING_ENDSTOPS) + // If the last move failed to trigger an endstop, call kill + void Endstops::validate_homing_move() { + if (trigger_state()) hit_on_purpose(); + else kill(PSTR(MSG_ERR_HOMING_FAILED)); + } +#endif // Enable / disable endstop z-probe checking #if HAS_BED_PROBE diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index a72c9cfd9..8e10579de 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -30,6 +30,8 @@ #include "../inc/MarlinConfig.h" #include +#define VALIDATE_HOMING_ENDSTOPS + enum EndstopEnum : char { X_MIN, Y_MIN, @@ -144,8 +146,12 @@ class Endstops { // Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable static void not_homing(); - // If the last move failed to trigger an endstop, call kill - static void validate_homing_move(); + #if ENABLED(VALIDATE_HOMING_ENDSTOPS) + // If the last move failed to trigger an endstop, call kill + static void validate_homing_move(); + #else + FORCE_INLINE static void validate_homing_move() { hit_on_purpose(); } + #endif // Clear endstops (i.e., they were hit intentionally) to suppress the report FORCE_INLINE static void hit_on_purpose() { hit_state = 0; }