Skip to content

Commit

Permalink
馃悰 Fix DETECT_BROKEN_ENDSTOP on IDEX (#26790)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
  • Loading branch information
janenen and thinkyhead committed Mar 16, 2024
1 parent 3a2c50c commit c0264ae
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Marlin/src/module/motion.cpp
Expand Up @@ -2183,18 +2183,28 @@ void prepare_line_to_destination() {
do_homing_move(axis, -bump, TERN(HOMING_Z_WITH_PROBE, (axis == Z_AXIS ? z_probe_fast_mm_s : 0), 0), false);

#if ENABLED(DETECT_BROKEN_ENDSTOP)

// Check for a broken endstop
EndstopEnum es;
switch (axis) {
#define _ESCASE(A) case A##_AXIS: es = A##_ENDSTOP; break;
MAIN_AXIS_MAP(_ESCASE)
default: break;
}

#if ENABLED(DUAL_X_CARRIAGE)
if (axis == X_AXIS && axis_home_dir > 0) {
es = X_MAX;
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("DUAL_X_CARRIAGE: Homing to X_MAX");
}
#endif

if (TEST(endstops.state(), es)) {
SERIAL_ECHO_MSG("Bad ", C(AXIS_CHAR(axis)), " Endstop?");
kill(GET_TEXT_F(MSG_KILL_HOMING_FAILED));
}
#endif

#endif // DETECT_BROKEN_ENDSTOP

#if ALL(HOMING_Z_WITH_PROBE, BLTOUCH)
if (axis == Z_AXIS && !bltouch.high_speed_mode && bltouch.deploy())
Expand Down

0 comments on commit c0264ae

Please sign in to comment.