Skip to content
This repository has been archived by the owner on Oct 25, 2020. It is now read-only.

Commit

Permalink
Merge commit 'e0a42d3f9afeea6f3e78782c8c744926fef6de77' into Prusai3v-12
Browse files Browse the repository at this point in the history
* commit 'e0a42d3f9afeea6f3e78782c8c744926fef6de77':
  Corrected Z_PROBE_ALLEN_KEY behaviour.
  Clean up Z_RAISE_AFTER_PROBING to work the same in all code paths except Z_PROBE_SLED.
  Blind fix for MarlinFirmware#1507

Resolved onflicts:
	Marlin/Marlin_main.cpp
  • Loading branch information
avluis committed Mar 23, 2015
2 parents ab19143 + e0a42d3 commit 701d2fd
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1309,24 +1309,26 @@ static void engage_z_probe() {
static void retract_z_probe() {
// Retract Z Servo endstop if enabled
#ifdef SERVO_ENDSTOPS
if (servo_endstops[Z_AXIS] > -1)
if (servo_endstops[Z_AXIS] > -1)
{
#if Z_RAISE_AFTER_PROBING > 0
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING);
st_synchronize();

#if SERVO_LEVELING
servos[servo_endstops[Z_AXIS]].attach(0);
#endif
servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]);
#if SERVO_LEVELING
#endif

#if SERVO_LEVELING
servos[servo_endstops[Z_AXIS]].attach(0);
#endif
servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]);
#if SERVO_LEVELING
delay(PROBE_SERVO_DEACTIVATION_DELAY);
servos[servo_endstops[Z_AXIS]].detach();
#endif
}
#elif defined(Z_PROBE_ALLEN_KEY)
// Move up for safety
feedrate = homing_feedrate[X_AXIS];
destination[Z_AXIS] = current_position[Z_AXIS] + 20;
destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING;
prepare_move_raw();

// Move to the start position to initiate retraction
Expand Down Expand Up @@ -1370,9 +1372,9 @@ static void retract_z_probe() {

enum ProbeAction
{
ProbeStay = 0,
ProbeEngage = (1 << 0),
ProbeRetract = (1 << 1),
ProbeStay = 0,
ProbeEngage = (1 << 0),
ProbeRetract = (1 << 1),
ProbeEngageAndRetract = (ProbeEngage | ProbeRetract),
};

Expand Down Expand Up @@ -2231,7 +2233,7 @@ inline void gcode_G28() {

#ifdef Z_PROBE_SLED
dock_sled(false); // engage (un-dock) the probe
#elif not defined(SERVO_ENDSTOPS)
#elif defined(Z_PROBE_ALLEN_KEY)
engage_z_probe();
#endif

Expand Down Expand Up @@ -2474,7 +2476,7 @@ inline void gcode_G28() {

#ifdef Z_PROBE_SLED
dock_sled(true, -SLED_DOCKING_OFFSET); // dock the probe, correcting for over-travel
#elif not defined(SERVO_ENDSTOPS)
#elif defined(Z_PROBE_ALLEN_KEY)
retract_z_probe();
#endif

Expand Down

0 comments on commit 701d2fd

Please sign in to comment.