Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Marlin/src/module/endstops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions Marlin/src/module/endstops.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "../inc/MarlinConfig.h"
#include <stdint.h>

#define VALIDATE_HOMING_ENDSTOPS

enum EndstopEnum : char {
X_MIN,
Y_MIN,
Expand Down Expand Up @@ -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; }
Expand Down