Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Mar 19, 2023
1 parent da2e508 commit 98f7678
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
12 changes: 7 additions & 5 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1387,11 +1387,13 @@
/**
* Z Servo Probe, such as an endstop switch on a rotating arm.
*/
//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector.
//#define Z_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles
//#define Z_SERVO_MEASURE_ANGLE 45 // Use if the servo must move to a "free" position for measuring after deploy.
//#define Z_SERVO_INTERMEDIATE_STOW // Stow the probe between points.
//#define Z_SERVO_DEACTIVATE_AFTER_STOW // Deactivate Z_SERVO when probe is stowed
//#define Z_PROBE_SERVO_NR 0
#ifdef Z_PROBE_SERVO_NR
//#define Z_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles
//#define Z_SERVO_MEASURE_ANGLE 45 // Use if the servo must move to a "free" position for measuring after deploy
//#define Z_SERVO_INTERMEDIATE_STOW // Stow the probe between points
//#define Z_SERVO_DEACTIVATE_AFTER_STOW // Deactivate the servo when probe is stowed
#endif

/**
* The BLTouch probe uses a Hall effect sensor and emulates a servo.
Expand Down
17 changes: 8 additions & 9 deletions Marlin/src/module/probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,16 +403,16 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {

#elif HAS_Z_SERVO_PROBE

// i.e., deploy ? DEPLOY_Z_SERVO() : STOW_Z_SERVO();
servo[Z_PROBE_SERVO_NR].move(servo_angles[Z_PROBE_SERVO_NR][deploy ? 0 : 1]);

#ifdef Z_SERVO_MEASURE_ANGLE
// After deploy move back to the measure angle...
if (deploy) MOVE_SERVO(Z_PROBE_SERVO_NR, Z_SERVO_MEASURE_ANGLE);
#endif
#ifdef Z_SERVO_DEACTIVATE_AFTER_STOW
if(!deploy)
servo[Z_PROBE_SERVO_NR].detach();
if (deploy) servo[Z_PROBE_SERVO_NR].move(Z_SERVO_MEASURE_ANGLE);
#endif

if (TERN0(Z_SERVO_DEACTIVATE_AFTER_STOW, !deploy)) servo[Z_PROBE_SERVO_NR].detach();

#elif ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, MAG_MOUNTED_PROBE)

deploy ? run_deploy_moves() : run_stow_moves();
Expand Down Expand Up @@ -952,10 +952,9 @@ 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!
*/
servo[Z_PROBE_SERVO_NR].move(servo_angles[Z_PROBE_SERVO_NR][1]);
#ifdef Z_SERVO_DEACTIVATE_AFTER_STOW
servo[Z_PROBE_SERVO_NR].detach();
#endif
STOW_Z_SERVO();

TERN_(Z_SERVO_DEACTIVATE_AFTER_STOW, servo[Z_PROBE_SERVO_NR].detach());
}

#endif // HAS_Z_SERVO_PROBE
Expand Down
2 changes: 1 addition & 1 deletion buildroot/tests/mega2560
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO NUM_SERVOS 1 \
NUM_RUNOUT_SENSORS 5 FIL_RUNOUT2_PIN 44 FIL_RUNOUT3_PIN 45 FIL_RUNOUT4_PIN 46 FIL_RUNOUT5_PIN 47 \
FIL_RUNOUT3_STATE HIGH FILAMENT_RUNOUT_SCRIPT '"M600 T%c"'
opt_enable VIKI2 BOOT_MARLIN_LOGO_ANIMATED SDSUPPORT AUTO_REPORT_SD_STATUS \
Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE \
Z_PROBE_SERVO_NR Z_SERVO_ANGLES Z_SERVO_MEASURE_ANGLE DEACTIVATE_SERVOS_AFTER_MOVE Z_SERVO_DEACTIVATE_AFTER_STOW \
AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE PROBE_PT_1 PROBE_PT_2 PROBE_PT_3 \
EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL AUTO_REPORT_POSITION \
NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \
Expand Down

0 comments on commit 98f7678

Please sign in to comment.