Skip to content

Commit

Permalink
Make raise_z_after_probing null sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jun 2, 2016
1 parent 28fb1f8 commit 9eecb44
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,12 @@ static void setup_for_endstop_move() {
}

inline void raise_z_after_probing() {
do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING);
#if Z_RAISE_AFTER_PROBING > 0
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("raise_z_after_probing()");
#endif
do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING);
#endif
}

static void clean_up_after_endstop_move() {
Expand Down Expand Up @@ -1822,14 +1827,6 @@ static void setup_for_endstop_move() {

#if Z_RAISE_AFTER_PROBING > 0
if (doRaise) {
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPAIR("Raise Z (after) by ", Z_RAISE_AFTER_PROBING);
SERIAL_EOL;
SERIAL_ECHO("> SERVO_ENDSTOPS > raise_z_after_probing()");
SERIAL_EOL;
}
#endif
raise_z_after_probing(); // this also updates current_position
stepper.synchronize();
}
Expand Down Expand Up @@ -2117,9 +2114,7 @@ static void setup_for_endstop_move() {

float oldXpos = current_position[X_AXIS]; // save x position
if (dock) {
#if Z_RAISE_AFTER_PROBING > 0
raise_z_after_probing(); // raise Z
#endif
raise_z_after_probing(); // raise Z
// Dock sled a bit closer to ensure proper capturing
do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1);
digitalWrite(SLED_PIN, LOW); // turn off magnet
Expand Down Expand Up @@ -3578,7 +3573,7 @@ inline void gcode_G28() {
// Allen Key Probe for Delta
#if ENABLED(Z_PROBE_ALLEN_KEY) || SERVO_LEVELING
stow_z_probe();
#elif Z_RAISE_AFTER_PROBING > 0
#else
raise_z_after_probing(); // for non Allen Key probes, such as simple mechanical probe
#endif
#else // !DELTA
Expand Down Expand Up @@ -3653,7 +3648,7 @@ inline void gcode_G28() {
// Sled assembly for Cartesian bots
#if ENABLED(Z_PROBE_SLED)
dock_sled(true); // dock the sled
#elif Z_RAISE_AFTER_PROBING > 0
#else
// Raise Z axis for non-delta and non servo based probes
#if DISABLED(HAS_SERVO_ENDSTOPS) && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED)
raise_z_after_probing();
Expand Down

0 comments on commit 9eecb44

Please sign in to comment.