Option for extra endstop check (#18424)

This commit is contained in:
Speaka
2020-07-12 20:16:56 +02:00
committed by GitHub
parent 4457b9d5d2
commit 2c238e4fc2
5 changed files with 29 additions and 11 deletions

View File

@ -1606,6 +1606,21 @@ void homeaxis(const AxisEnum axis) {
#endif
);
#if ENABLED(DETECT_BROKEN_ENDSTOP)
// Check for a broken endstop
EndstopEnum es;
switch (axis) {
default:
case X_AXIS: es = X_ENDSTOP; break;
case Y_AXIS: es = Y_ENDSTOP; break;
case Z_AXIS: es = Z_ENDSTOP; break;
}
if (TEST(endstops.state(), es)) {
SERIAL_ECHO_MSG("Bad ", axis_codes[axis], " Endstop?");
kill(GET_TEXT(MSG_KILL_HOMING_FAILED));
}
#endif
// Slow move towards endstop until triggered
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Home 2 Slow:");