Skip to content

Commit

Permalink
🐛 Fix DETECT_BROKEN_ENDSTOP on IDEX (MarlinFirmware#26790)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <[email protected]>
  • Loading branch information
janenen and thinkyhead committed Mar 27, 2024
1 parent 9755d8e commit 2378a7f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2046,18 +2046,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 2378a7f

Please sign in to comment.