Skip to content
Merged
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
47 changes: 21 additions & 26 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2967,16 +2967,9 @@ static void do_homing_move(const AxisEnum axis, const float distance, const floa

if (is_home_dir) {

if (axis == Z_AXIS) {
#if HOMING_Z_WITH_PROBE
#if ENABLED(BLTOUCH)
set_bltouch_deployed(true);
#endif
#if QUIET_PROBING
probing_pause(true);
#endif
#endif
}
#if HOMING_Z_WITH_PROBE && QUIET_PROBING
if (axis == Z_AXIS) probing_pause(true);
#endif

// Disable stealthChop if used. Enable diag1 pin on driver.
#if ENABLED(SENSORLESS_HOMING)
Expand All @@ -3003,16 +2996,9 @@ static void do_homing_move(const AxisEnum axis, const float distance, const floa

if (is_home_dir) {

if (axis == Z_AXIS) {
#if HOMING_Z_WITH_PROBE
#if QUIET_PROBING
probing_pause(false);
#endif
#if ENABLED(BLTOUCH)
set_bltouch_deployed(false);
#endif
#endif
}
#if HOMING_Z_WITH_PROBE && QUIET_PROBING
if (axis == Z_AXIS) probing_pause(false);
#endif

endstops.validate_homing_move();

Expand Down Expand Up @@ -3095,6 +3081,10 @@ static void homeaxis(const AxisEnum axis) {
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 1 Fast:");
#endif
do_homing_move(axis, 1.5f * max_length(axis) * axis_home_dir);
#if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
// BLTOUCH needs to be stowed after trigger to let rearm itself
if (axis == Z_AXIS) set_bltouch_deployed(false);
#endif

// When homing Z with probe respect probe clearance
const float bump = axis_home_dir * (
Expand All @@ -3120,9 +3110,19 @@ static void homeaxis(const AxisEnum axis) {
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 2 Slow:");
#endif

#if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
// BLTOUCH needs to deploy everytime
if (axis == Z_AXIS && set_bltouch_deployed(true)) return;
#endif
do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis));
}

// Put away the Z probe
#if HOMING_Z_WITH_PROBE
if (axis == Z_AXIS && STOW_PROBE()) return;
#endif

/**
* Home axes that have dual endstops... differently
*/
Expand Down Expand Up @@ -3198,11 +3198,6 @@ static void homeaxis(const AxisEnum axis) {

#endif

// Put away the Z probe
#if HOMING_Z_WITH_PROBE
if (axis == Z_AXIS && STOW_PROBE()) return;
#endif

// Clear retracted status if homing the Z axis
#if ENABLED(FWRETRACT)
if (axis == Z_AXIS) fwretract.hop_amount = 0.0;
Expand Down Expand Up @@ -4107,6 +4102,7 @@ inline void gcode_G28(const bool always_home_all) {
#endif

#if ENABLED(BLTOUCH)
// Make sure any BLTouch error condition is cleared
bltouch_command(BLTOUCH_RESET);
set_bltouch_deployed(false);
#endif
Expand Down Expand Up @@ -14614,7 +14610,6 @@ void setup() {
#if ENABLED(BLTOUCH)
// Make sure any BLTouch error condition is cleared
bltouch_command(BLTOUCH_RESET);
set_bltouch_deployed(true);
set_bltouch_deployed(false);
#endif

Expand Down