From 17c9450f0c0ff96405ba8f60873adebd3aca91ff Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 11 Sep 2021 15:41:42 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Apply=20more=20HAS=5FDELTA=5FSEN?= =?UTF-8?q?SORLESS=5FPROBING?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/calibrate/G33.cpp | 2 +- Marlin/src/module/delta.cpp | 2 +- Marlin/src/module/endstops.cpp | 2 +- Marlin/src/module/probe.cpp | 14 +++++++------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 597801cf52..95a862b5f7 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -425,7 +425,7 @@ void GcodeSuite::G33() { const bool stow_after_each = parser.seen_test('E'); - #if ENABLED(SENSORLESS_PROBING) + #if HAS_DELTA_SENSORLESS_PROBING probe.test_sensitivity.x = !parser.seen_test('X'); TERN_(HAS_Y_AXIS, probe.test_sensitivity.y = !parser.seen_test('Y')); TERN_(HAS_Z_AXIS, probe.test_sensitivity.z = !parser.seen_test('Z')); diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index 899848d7f2..4401db5a5b 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -254,7 +254,7 @@ void home_delta() { current_position.z = DIFF_TERN(HAS_BED_PROBE, delta_height + 10, probe.offset.z); line_to_current_position(homing_feedrate(Z_AXIS)); planner.synchronize(); - TERN_(SENSORLESS_PROBING,endstops.report_states()); + TERN_(HAS_DELTA_SENSORLESS_PROBING, endstops.report_states()); // Re-enable stealthChop if used. Disable diag1 pin on driver. #if ENABLED(SENSORLESS_HOMING) && DISABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index b5315f2f01..d29fd3ecb3 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -595,7 +595,7 @@ void _O2 Endstops::report_states() { // The following routines are called from an ISR context. It could be the temperature ISR, the // endstop ISR or the Stepper ISR. -#if BOTH(DELTA, SENSORLESS_PROBING) +#if HAS_DELTA_SENSORLESS_PROBING #define __ENDSTOP(AXIS, ...) AXIS ##_MAX #define _ENDSTOP_PIN(AXIS, ...) AXIS ##_MAX_PIN #define _ENDSTOP_INVERTING(AXIS, ...) AXIS ##_MAX_ENDSTOP_INVERTING diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 3b8a4a520f..071ff25c20 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -493,7 +493,7 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { // Disable stealthChop if used. Enable diag1 pin on driver. #if ENABLED(SENSORLESS_PROBING) sensorless_t stealth_states { false }; - #if ENABLED(DELTA) + #if HAS_DELTA_SENSORLESS_PROBING if (probe.test_sensitivity.x) stealth_states.x = tmc_enable_stallguard(stepperX); // Delta watches all DIAG pins for a stall if (probe.test_sensitivity.y) stealth_states.y = tmc_enable_stallguard(stepperY); #endif @@ -509,7 +509,7 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { // Check to see if the probe was triggered const bool probe_triggered = - #if BOTH(DELTA, SENSORLESS_PROBING) + #if HAS_DELTA_SENSORLESS_PROBING endstops.trigger_state() & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)) #else 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) { // Re-enable stealthChop if used. Disable diag1 pin on driver. #if ENABLED(SENSORLESS_PROBING) endstops.not_homing(); - #if ENABLED(DELTA) + #if HAS_DELTA_SENSORLESS_PROBING if (probe.test_sensitivity.x) tmc_disable_stallguard(stepperX, stealth_states.x); if (probe.test_sensitivity.y) tmc_disable_stallguard(stepperY, stealth_states.y); #endif @@ -765,7 +765,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai #endif // On delta keep Z below clip height or do_blocking_move_to will abort - xyz_pos_t npos = { rx, ry, _MIN(TERN(DELTA, delta_clip_start_height, current_position.z), current_position.z) }; + xyz_pos_t npos = { rx, ry, TERN(DELTA, _MIN(delta_clip_start_height, current_position.z), current_position.z) }; if (probe_relative) { // The given position is in terms of the probe if (!can_reach(npos)) { 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 */ void Probe::enable_stallguard_diag1() { #if ENABLED(SENSORLESS_PROBING) - #if ENABLED(DELTA) + #if HAS_DELTA_SENSORLESS_PROBING stealth_states.x = tmc_enable_stallguard(stepperX); stealth_states.y = tmc_enable_stallguard(stepperY); #endif @@ -842,7 +842,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai void Probe::disable_stallguard_diag1() { #if ENABLED(SENSORLESS_PROBING) endstops.not_homing(); - #if ENABLED(DELTA) + #if HAS_DELTA_SENSORLESS_PROBING tmc_disable_stallguard(stepperX, stealth_states.x); tmc_disable_stallguard(stepperY, stealth_states.y); #endif @@ -907,6 +907,6 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai #endif } -#endif // SENSORLESS_PROBING +#endif // SENSORLESS_PROBING || SENSORLESS_HOMING #endif // HAS_BED_PROBE