Browse Source

Easier to disable homing validation (#11458)

Scott Lahteine 7 years ago
parent
commit
79835590e3
No account linked to committer's email address
2 changed files with 15 additions and 7 deletions
  1. 7
    5
      Marlin/src/module/endstops.cpp
  2. 8
    2
      Marlin/src/module/endstops.h

+ 7
- 5
Marlin/src/module/endstops.cpp View File

@@ -256,11 +256,13 @@ void Endstops::not_homing() {
256 256
   #endif
257 257
 }
258 258
 
259
-// If the last move failed to trigger an endstop, call kill
260
-void Endstops::validate_homing_move() {
261
-  if (trigger_state()) hit_on_purpose();
262
-  else kill(PSTR(MSG_ERR_HOMING_FAILED));
263
-}
259
+#if ENABLED(VALIDATE_HOMING_ENDSTOPS)
260
+  // If the last move failed to trigger an endstop, call kill
261
+  void Endstops::validate_homing_move() {
262
+    if (trigger_state()) hit_on_purpose();
263
+    else kill(PSTR(MSG_ERR_HOMING_FAILED));
264
+  }
265
+#endif
264 266
 
265 267
 // Enable / disable endstop z-probe checking
266 268
 #if HAS_BED_PROBE

+ 8
- 2
Marlin/src/module/endstops.h View File

@@ -30,6 +30,8 @@
30 30
 #include "../inc/MarlinConfig.h"
31 31
 #include <stdint.h>
32 32
 
33
+#define VALIDATE_HOMING_ENDSTOPS
34
+
33 35
 enum EndstopEnum : char {
34 36
   X_MIN,
35 37
   Y_MIN,
@@ -144,8 +146,12 @@ class Endstops {
144 146
     // Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable
145 147
     static void not_homing();
146 148
 
147
-    // If the last move failed to trigger an endstop, call kill
148
-    static void validate_homing_move();
149
+    #if ENABLED(VALIDATE_HOMING_ENDSTOPS)
150
+      // If the last move failed to trigger an endstop, call kill
151
+      static void validate_homing_move();
152
+    #else
153
+      FORCE_INLINE static void validate_homing_move() { hit_on_purpose(); }
154
+    #endif
149 155
 
150 156
     // Clear endstops (i.e., they were hit intentionally) to suppress the report
151 157
     FORCE_INLINE static void hit_on_purpose() { hit_state = 0; }

Loading…
Cancel
Save