Skip to content

Commit

Permalink
Use the expressive macros
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed May 21, 2022
1 parent 3308cc9 commit e2e7ba8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
22 changes: 12 additions & 10 deletions Marlin/src/module/probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,13 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {

#elif HAS_Z_SERVO_PROBE

MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][deploy ? 0 : 1]);
#ifdef Z_SERVO_DEACTIVATE_AFTER_STOW
if(!deploy)
DETACH_SERVO(Z_PROBE_SERVO_NR);
#endif
if (deploy)
DEPLOY_Z_SERVO(Z_PROBE_SERVO_NR);
else {
STOW_Z_SERVO(Z_PROBE_SERVO_NR);
TERN_(Z_SERVO_DEACTIVATE_AFTER_STOW, DETACH_SERVO(Z_PROBE_SERVO_NR));
}

#elif EITHER(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY)

deploy ? run_deploy_moves_script() : run_stow_moves_script();
Expand Down Expand Up @@ -861,14 +863,14 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
* There's no way to know where the nozzle is positioned until
* homing has been done - no homing with z-probe without init!
*/
//
MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][1]);
#ifdef Z_SERVO_DEACTIVATE_AFTER_STOW
DETACH_SERVO(Z_PROBE_SERVO_NR);
STOW_Z_SERVO();

#if ENABLED(Z_SERVO_DEACTIVATE_AFTER_STOW)
DETACH_SERVO(Z_PROBE_SERVO_NR);
#endif
}

#endif // HAS_Z_SERVO_PROBE
#endif

#if USE_SENSORLESS

Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/module/servo.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@
#endif
};

#if HAS_Z_SERVO_PROBE
#define DEPLOY_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][0])
#define STOW_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][1])
#endif

#endif // HAS_SERVO_ANGLES

Expand Down

0 comments on commit e2e7ba8

Please sign in to comment.