Merge pull request #4551 from thinkyhead/rc_anhardt_rep_stow_allen
Make Allen Key Probe stow
This commit is contained in:
commit
7145bd085d
1 changed files with 27 additions and 17 deletions
|
@ -2063,28 +2063,36 @@ static void clean_up_after_endstop_or_probe_move() {
|
||||||
float oldYpos = current_position[Y_AXIS]; // save y position
|
float oldYpos = current_position[Y_AXIS]; // save y position
|
||||||
|
|
||||||
#ifdef _TRIGGERED_WHEN_STOWED_TEST
|
#ifdef _TRIGGERED_WHEN_STOWED_TEST
|
||||||
|
|
||||||
// If endstop is already false, the Z probe is deployed
|
// If endstop is already false, the Z probe is deployed
|
||||||
if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // closed after the probe specific actions.
|
if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // closed after the probe specific actions.
|
||||||
// Would a goto be less ugly?
|
// Would a goto be less ugly?
|
||||||
//while (!_TRIGGERED_WHEN_STOWED_TEST) { idle(); // would offer the opportunity
|
//while (!_TRIGGERED_WHEN_STOWED_TEST) idle(); // would offer the opportunity
|
||||||
// for a triggered when stowed manual probe.
|
// for a triggered when stowed manual probe.
|
||||||
|
|
||||||
|
if (!deploy) endstops.enable_z_probe(false); // Switch off triggered when stowed probes early
|
||||||
|
// otherwise an Allen-Key probe can't be stowed.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(Z_PROBE_SLED)
|
#if ENABLED(Z_PROBE_SLED)
|
||||||
dock_sled(!deploy);
|
|
||||||
#elif HAS_Z_SERVO_ENDSTOP
|
dock_sled(!deploy);
|
||||||
servo[Z_ENDSTOP_SERVO_NR].move(z_servo_angle[((deploy) ? 0 : 1)]);
|
|
||||||
#elif ENABLED(Z_PROBE_ALLEN_KEY)
|
#elif HAS_Z_SERVO_ENDSTOP
|
||||||
if (!deploy) run_stow_moves_script();
|
|
||||||
else run_deploy_moves_script();
|
servo[Z_ENDSTOP_SERVO_NR].move(z_servo_angle[deploy ? 0 : 1]);
|
||||||
#else
|
|
||||||
// Nothing to be done. Just enable_z_probe below...
|
#elif ENABLED(Z_PROBE_ALLEN_KEY)
|
||||||
#endif
|
|
||||||
|
deploy ? run_deploy_moves_script() : run_stow_moves_script();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _TRIGGERED_WHEN_STOWED_TEST
|
#ifdef _TRIGGERED_WHEN_STOWED_TEST
|
||||||
}; // opened before the probe specific actions
|
} // _TRIGGERED_WHEN_STOWED_TEST == deploy
|
||||||
|
|
||||||
|
if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // State hasn't changed?
|
||||||
|
|
||||||
if (_TRIGGERED_WHEN_STOWED_TEST == deploy) {
|
|
||||||
if (IsRunning()) {
|
if (IsRunning()) {
|
||||||
SERIAL_ERROR_START;
|
SERIAL_ERROR_START;
|
||||||
SERIAL_ERRORLNPGM("Z-Probe failed");
|
SERIAL_ERRORLNPGM("Z-Probe failed");
|
||||||
|
@ -2092,7 +2100,9 @@ static void clean_up_after_endstop_or_probe_move() {
|
||||||
}
|
}
|
||||||
stop();
|
stop();
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
} // _TRIGGERED_WHEN_STOWED_TEST == deploy
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
do_blocking_move_to(oldXpos, oldYpos, current_position[Z_AXIS]); // return to position before deploy
|
do_blocking_move_to(oldXpos, oldYpos, current_position[Z_AXIS]); // return to position before deploy
|
||||||
|
|
Reference in a new issue