Skip to content

Commit 778eef5

Browse files
thinkyheadDarred
authored andcommitted
🎨 Apply more HAS_DELTA_SENSORLESS_PROBING
1 parent ae41811 commit 778eef5

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Marlin/src/gcode/calibrate/G33.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ void GcodeSuite::G33() {
425425

426426
const bool stow_after_each = parser.seen_test('E');
427427

428-
#if ENABLED(SENSORLESS_PROBING)
428+
#if HAS_DELTA_SENSORLESS_PROBING
429429
probe.test_sensitivity.x = !parser.seen_test('X');
430430
TERN_(HAS_Y_AXIS, probe.test_sensitivity.y = !parser.seen_test('Y'));
431431
TERN_(HAS_Z_AXIS, probe.test_sensitivity.z = !parser.seen_test('Z'));

Marlin/src/module/delta.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ void home_delta() {
254254
current_position.z = DIFF_TERN(HAS_BED_PROBE, delta_height + 10, probe.offset.z);
255255
line_to_current_position(homing_feedrate(Z_AXIS));
256256
planner.synchronize();
257-
TERN_(SENSORLESS_PROBING,endstops.report_states());
257+
TERN_(HAS_DELTA_SENSORLESS_PROBING, endstops.report_states());
258258

259259
// Re-enable stealthChop if used. Disable diag1 pin on driver.
260260
#if ENABLED(SENSORLESS_HOMING) && DISABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)

Marlin/src/module/endstops.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ void _O2 Endstops::report_states() {
595595
// The following routines are called from an ISR context. It could be the temperature ISR, the
596596
// endstop ISR or the Stepper ISR.
597597

598-
#if BOTH(DELTA, SENSORLESS_PROBING)
598+
#if HAS_DELTA_SENSORLESS_PROBING
599599
#define __ENDSTOP(AXIS, ...) AXIS ##_MAX
600600
#define _ENDSTOP_PIN(AXIS, ...) AXIS ##_MAX_PIN
601601
#define _ENDSTOP_INVERTING(AXIS, ...) AXIS ##_MAX_ENDSTOP_INVERTING

Marlin/src/module/probe.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) {
493493
// Disable stealthChop if used. Enable diag1 pin on driver.
494494
#if ENABLED(SENSORLESS_PROBING)
495495
sensorless_t stealth_states { false };
496-
#if ENABLED(DELTA)
496+
#if HAS_DELTA_SENSORLESS_PROBING
497497
if (probe.test_sensitivity.x) stealth_states.x = tmc_enable_stallguard(stepperX); // Delta watches all DIAG pins for a stall
498498
if (probe.test_sensitivity.y) stealth_states.y = tmc_enable_stallguard(stepperY);
499499
#endif
@@ -509,7 +509,7 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) {
509509

510510
// Check to see if the probe was triggered
511511
const bool probe_triggered =
512-
#if BOTH(DELTA, SENSORLESS_PROBING)
512+
#if HAS_DELTA_SENSORLESS_PROBING
513513
endstops.trigger_state() & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX))
514514
#else
515515
TEST(endstops.trigger_state(), Z_MIN_PROBE)
@@ -521,7 +521,7 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) {
521521
// Re-enable stealthChop if used. Disable diag1 pin on driver.
522522
#if ENABLED(SENSORLESS_PROBING)
523523
endstops.not_homing();
524-
#if ENABLED(DELTA)
524+
#if HAS_DELTA_SENSORLESS_PROBING
525525
if (probe.test_sensitivity.x) tmc_disable_stallguard(stepperX, stealth_states.x);
526526
if (probe.test_sensitivity.y) tmc_disable_stallguard(stepperY, stealth_states.y);
527527
#endif
@@ -765,7 +765,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
765765
#endif
766766

767767
// On delta keep Z below clip height or do_blocking_move_to will abort
768-
xyz_pos_t npos = { rx, ry, _MIN(TERN(DELTA, delta_clip_start_height, current_position.z), current_position.z) };
768+
xyz_pos_t npos = { rx, ry, TERN(DELTA, _MIN(delta_clip_start_height, current_position.z), current_position.z) };
769769
if (probe_relative) { // The given position is in terms of the probe
770770
if (!can_reach(npos)) {
771771
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Position Not Reachable");
@@ -827,7 +827,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
827827
*/
828828
void Probe::enable_stallguard_diag1() {
829829
#if ENABLED(SENSORLESS_PROBING)
830-
#if ENABLED(DELTA)
830+
#if HAS_DELTA_SENSORLESS_PROBING
831831
stealth_states.x = tmc_enable_stallguard(stepperX);
832832
stealth_states.y = tmc_enable_stallguard(stepperY);
833833
#endif
@@ -842,7 +842,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
842842
void Probe::disable_stallguard_diag1() {
843843
#if ENABLED(SENSORLESS_PROBING)
844844
endstops.not_homing();
845-
#if ENABLED(DELTA)
845+
#if HAS_DELTA_SENSORLESS_PROBING
846846
tmc_disable_stallguard(stepperX, stealth_states.x);
847847
tmc_disable_stallguard(stepperY, stealth_states.y);
848848
#endif
@@ -907,6 +907,6 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
907907
#endif
908908
}
909909

910-
#endif // SENSORLESS_PROBING
910+
#endif // SENSORLESS_PROBING || SENSORLESS_HOMING
911911

912912
#endif // HAS_BED_PROBE

0 commit comments

Comments
 (0)