🎨 Fix L64xx enable, clean up conditionals
This commit is contained in:
@ -48,8 +48,17 @@
|
||||
#include "delta.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
#include "planner.h"
|
||||
#if ANY(HAS_QUIET_PROBING, USE_SENSORLESS)
|
||||
#include "stepper/indirection.h"
|
||||
#if BOTH(HAS_QUIET_PROBING, PROBING_ESTEPPERS_OFF)
|
||||
#include "stepper.h"
|
||||
#endif
|
||||
#if USE_SENSORLESS
|
||||
#include "../feature/tmc_util.h"
|
||||
#if ENABLED(IMPROVE_HOMING_RELIABILITY)
|
||||
#include "planner.h"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(MEASURE_BACKLASH_WHEN_PROBING)
|
||||
@ -68,15 +77,6 @@
|
||||
#include "servo.h"
|
||||
#endif
|
||||
|
||||
#if EITHER(SENSORLESS_PROBING, SENSORLESS_HOMING)
|
||||
#include "stepper.h"
|
||||
#include "../feature/tmc_util.h"
|
||||
#endif
|
||||
|
||||
#if HAS_QUIET_PROBING
|
||||
#include "stepper/indirection.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
#include "../lcd/extui/ui_api.h"
|
||||
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
|
||||
@ -818,7 +818,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
|
||||
|
||||
#endif // HAS_Z_SERVO_PROBE
|
||||
|
||||
#if EITHER(SENSORLESS_PROBING, SENSORLESS_HOMING)
|
||||
#if USE_SENSORLESS
|
||||
|
||||
sensorless_t stealth_states { false };
|
||||
|
||||
|
@ -263,7 +263,7 @@ public:
|
||||
#endif
|
||||
|
||||
// Basic functions for Sensorless Homing and Probing
|
||||
#if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING)
|
||||
#if USE_SENSORLESS
|
||||
static void enable_stallguard_diag1();
|
||||
static void disable_stallguard_diag1();
|
||||
static void set_homing_current(const bool onoff);
|
||||
|
@ -667,183 +667,87 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
|
||||
//
|
||||
|
||||
#ifndef ENABLE_STEPPER_X
|
||||
#if HAS_X_ENABLE
|
||||
#define ENABLE_STEPPER_X() X_ENABLE_WRITE( X_ENABLE_ON)
|
||||
#else
|
||||
#define ENABLE_STEPPER_X() NOOP
|
||||
#endif
|
||||
#define ENABLE_STEPPER_X() TERN(HAS_X_ENABLE, X_ENABLE_WRITE( X_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
#ifndef DISABLE_STEPPER_X
|
||||
#if HAS_X_ENABLE
|
||||
#define DISABLE_STEPPER_X() X_ENABLE_WRITE(!X_ENABLE_ON)
|
||||
#else
|
||||
#define DISABLE_STEPPER_X() NOOP
|
||||
#endif
|
||||
#define DISABLE_STEPPER_X() TERN(HAS_X_ENABLE, X_ENABLE_WRITE(!X_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_STEPPER_X2
|
||||
#if HAS_X2_ENABLE
|
||||
#define ENABLE_STEPPER_X2() X2_ENABLE_WRITE( X_ENABLE_ON)
|
||||
#else
|
||||
#define ENABLE_STEPPER_X2() NOOP
|
||||
#endif
|
||||
#define ENABLE_STEPPER_X2() TERN(HAS_X2_ENABLE, X2_ENABLE_WRITE( X_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
#ifndef DISABLE_STEPPER_X2
|
||||
#if HAS_X2_ENABLE
|
||||
#define DISABLE_STEPPER_X2() X2_ENABLE_WRITE(!X_ENABLE_ON)
|
||||
#else
|
||||
#define DISABLE_STEPPER_X2() NOOP
|
||||
#endif
|
||||
#define DISABLE_STEPPER_X2() TERN(HAS_X2_ENABLE, X2_ENABLE_WRITE(!X_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_STEPPER_Y
|
||||
#if HAS_Y_ENABLE
|
||||
#define ENABLE_STEPPER_Y() Y_ENABLE_WRITE( Y_ENABLE_ON)
|
||||
#else
|
||||
#define ENABLE_STEPPER_Y() NOOP
|
||||
#endif
|
||||
#define ENABLE_STEPPER_Y() TERN(HAS_Y_ENABLE, Y_ENABLE_WRITE( Y_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
#ifndef DISABLE_STEPPER_Y
|
||||
#if HAS_Y_ENABLE
|
||||
#define DISABLE_STEPPER_Y() Y_ENABLE_WRITE(!Y_ENABLE_ON)
|
||||
#else
|
||||
#define DISABLE_STEPPER_Y() NOOP
|
||||
#endif
|
||||
#define DISABLE_STEPPER_Y() TERN(HAS_Y_ENABLE, Y_ENABLE_WRITE(!Y_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_STEPPER_Y2
|
||||
#if HAS_Y2_ENABLE
|
||||
#define ENABLE_STEPPER_Y2() Y2_ENABLE_WRITE( Y_ENABLE_ON)
|
||||
#else
|
||||
#define ENABLE_STEPPER_Y2() NOOP
|
||||
#endif
|
||||
#define ENABLE_STEPPER_Y2() TERN(HAS_Y2_ENABLE, Y2_ENABLE_WRITE( Y_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
#ifndef DISABLE_STEPPER_Y2
|
||||
#if HAS_Y2_ENABLE
|
||||
#define DISABLE_STEPPER_Y2() Y2_ENABLE_WRITE(!Y_ENABLE_ON)
|
||||
#else
|
||||
#define DISABLE_STEPPER_Y2() NOOP
|
||||
#endif
|
||||
#define DISABLE_STEPPER_Y2() TERN(HAS_Y2_ENABLE, Y2_ENABLE_WRITE(!Y_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_STEPPER_Z
|
||||
#if HAS_Z_ENABLE
|
||||
#define ENABLE_STEPPER_Z() Z_ENABLE_WRITE( Z_ENABLE_ON)
|
||||
#else
|
||||
#define ENABLE_STEPPER_Z() NOOP
|
||||
#endif
|
||||
#define ENABLE_STEPPER_Z() TERN(HAS_Z_ENABLE, Z_ENABLE_WRITE( Z_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
#ifndef DISABLE_STEPPER_Z
|
||||
#if HAS_Z_ENABLE
|
||||
#define DISABLE_STEPPER_Z() Z_ENABLE_WRITE(!Z_ENABLE_ON)
|
||||
#else
|
||||
#define DISABLE_STEPPER_Z() NOOP
|
||||
#endif
|
||||
#define DISABLE_STEPPER_Z() TERN(HAS_Z_ENABLE, Z_ENABLE_WRITE(!Z_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_STEPPER_Z2
|
||||
#if HAS_Z2_ENABLE
|
||||
#define ENABLE_STEPPER_Z2() Z2_ENABLE_WRITE( Z_ENABLE_ON)
|
||||
#else
|
||||
#define ENABLE_STEPPER_Z2() NOOP
|
||||
#endif
|
||||
#define ENABLE_STEPPER_Z2() TERN(HAS_Z2_ENABLE, Z2_ENABLE_WRITE( Z_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
#ifndef DISABLE_STEPPER_Z2
|
||||
#if HAS_Z2_ENABLE
|
||||
#define DISABLE_STEPPER_Z2() Z2_ENABLE_WRITE(!Z_ENABLE_ON)
|
||||
#else
|
||||
#define DISABLE_STEPPER_Z2() NOOP
|
||||
#endif
|
||||
#define DISABLE_STEPPER_Z2() TERN(HAS_Z2_ENABLE, Z2_ENABLE_WRITE(!Z_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_STEPPER_Z3
|
||||
#if HAS_Z3_ENABLE
|
||||
#define ENABLE_STEPPER_Z3() Z3_ENABLE_WRITE( Z_ENABLE_ON)
|
||||
#else
|
||||
#define ENABLE_STEPPER_Z3() NOOP
|
||||
#endif
|
||||
#define ENABLE_STEPPER_Z3() TERN(HAS_Z3_ENABLE, Z3_ENABLE_WRITE( Z_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
#ifndef DISABLE_STEPPER_Z3
|
||||
#if HAS_Z3_ENABLE
|
||||
#define DISABLE_STEPPER_Z3() Z3_ENABLE_WRITE(!Z_ENABLE_ON)
|
||||
#else
|
||||
#define DISABLE_STEPPER_Z3() NOOP
|
||||
#endif
|
||||
#define DISABLE_STEPPER_Z3() TERN(HAS_Z3_ENABLE, Z3_ENABLE_WRITE(!Z_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_STEPPER_Z4
|
||||
#if HAS_Z4_ENABLE
|
||||
#define ENABLE_STEPPER_Z4() Z4_ENABLE_WRITE( Z_ENABLE_ON)
|
||||
#else
|
||||
#define ENABLE_STEPPER_Z4() NOOP
|
||||
#endif
|
||||
#define ENABLE_STEPPER_Z4() TERN(HAS_Z4_ENABLE, Z4_ENABLE_WRITE( Z_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
#ifndef DISABLE_STEPPER_Z4
|
||||
#if HAS_Z4_ENABLE
|
||||
#define DISABLE_STEPPER_Z4() Z4_ENABLE_WRITE(!Z_ENABLE_ON)
|
||||
#else
|
||||
#define DISABLE_STEPPER_Z4() NOOP
|
||||
#endif
|
||||
#define DISABLE_STEPPER_Z4() TERN(HAS_Z4_ENABLE, Z4_ENABLE_WRITE(!Z_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_STEPPER_I
|
||||
#if HAS_I_ENABLE
|
||||
#define ENABLE_STEPPER_I() I_ENABLE_WRITE( I_ENABLE_ON)
|
||||
#else
|
||||
#define ENABLE_STEPPER_I() NOOP
|
||||
#endif
|
||||
#define ENABLE_STEPPER_I() TERN(HAS_I_ENABLE, I_ENABLE_WRITE( I_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
#ifndef DISABLE_STEPPER_I
|
||||
#if HAS_I_ENABLE
|
||||
#define DISABLE_STEPPER_I() I_ENABLE_WRITE(!I_ENABLE_ON)
|
||||
#else
|
||||
#define DISABLE_STEPPER_I() NOOP
|
||||
#endif
|
||||
#define DISABLE_STEPPER_I() TERN(HAS_I_ENABLE, I_ENABLE_WRITE(!I_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_STEPPER_J
|
||||
#if HAS_J_ENABLE
|
||||
#define ENABLE_STEPPER_J() J_ENABLE_WRITE( J_ENABLE_ON)
|
||||
#else
|
||||
#define ENABLE_STEPPER_J() NOOP
|
||||
#endif
|
||||
#define ENABLE_STEPPER_J() TERN(HAS_J_ENABLE, J_ENABLE_WRITE( J_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
#ifndef DISABLE_STEPPER_J
|
||||
#if HAS_J_ENABLE
|
||||
#define DISABLE_STEPPER_J() J_ENABLE_WRITE(!J_ENABLE_ON)
|
||||
#else
|
||||
#define DISABLE_STEPPER_J() NOOP
|
||||
#endif
|
||||
#define DISABLE_STEPPER_J() TERN(HAS_J_ENABLE, J_ENABLE_WRITE(!J_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_STEPPER_K
|
||||
#if HAS_K_ENABLE
|
||||
#define ENABLE_STEPPER_K() K_ENABLE_WRITE( K_ENABLE_ON)
|
||||
#else
|
||||
#define ENABLE_STEPPER_K() NOOP
|
||||
#endif
|
||||
#define ENABLE_STEPPER_K() TERN(HAS_K_ENABLE, K_ENABLE_WRITE( K_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
#ifndef DISABLE_STEPPER_K
|
||||
#if HAS_K_ENABLE
|
||||
#define DISABLE_STEPPER_K() K_ENABLE_WRITE(!K_ENABLE_ON)
|
||||
#else
|
||||
#define DISABLE_STEPPER_K() NOOP
|
||||
#endif
|
||||
#define DISABLE_STEPPER_K() TERN(HAS_K_ENABLE, K_ENABLE_WRITE(!K_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_STEPPER_E0
|
||||
#if HAS_E0_ENABLE
|
||||
#define ENABLE_STEPPER_E0() E0_ENABLE_WRITE( E_ENABLE_ON)
|
||||
#else
|
||||
#define ENABLE_STEPPER_E0() NOOP
|
||||
#endif
|
||||
#define ENABLE_STEPPER_E0() TERN(HAS_E0_ENABLE, E0_ENABLE_WRITE( E_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
#ifndef DISABLE_STEPPER_E0
|
||||
#if HAS_E0_ENABLE
|
||||
#define DISABLE_STEPPER_E0() E0_ENABLE_WRITE(!E_ENABLE_ON)
|
||||
#else
|
||||
#define DISABLE_STEPPER_E0() NOOP
|
||||
#endif
|
||||
#define DISABLE_STEPPER_E0() TERN(HAS_E0_ENABLE, E0_ENABLE_WRITE(!E_ENABLE_ON), NOOP)
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_STEPPER_E1
|
||||
|
@ -194,7 +194,7 @@ void reset_trinamic_drivers();
|
||||
#define CHOPPER_TIMING_Z2 CHOPPER_TIMING_Z
|
||||
#endif
|
||||
static constexpr chopper_timing_t chopper_timing_Z2 = CHOPPER_TIMING_Z2;
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2)
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE)
|
||||
#define Z2_ENABLE_INIT() NOOP
|
||||
#define Z2_ENABLE_WRITE(STATE) stepperZ2.toff((STATE)==Z_ENABLE_ON ? chopper_timing_Z2.toff : 0)
|
||||
#define Z2_ENABLE_READ() stepperZ2.isEnabled()
|
||||
@ -287,7 +287,7 @@ void reset_trinamic_drivers();
|
||||
#define CHOPPER_TIMING_E0 CHOPPER_TIMING_E
|
||||
#endif
|
||||
static constexpr chopper_timing_t chopper_timing_E0 = CHOPPER_TIMING_E0;
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0)
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE)
|
||||
#define E0_ENABLE_INIT() NOOP
|
||||
#define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E_ENABLE_ON ? chopper_timing_E0.toff : 0)
|
||||
#define E0_ENABLE_READ() stepperE0.isEnabled()
|
||||
@ -304,7 +304,7 @@ void reset_trinamic_drivers();
|
||||
#define CHOPPER_TIMING_E1 CHOPPER_TIMING_E
|
||||
#endif
|
||||
static constexpr chopper_timing_t chopper_timing_E1 = CHOPPER_TIMING_E1;
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1)
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE)
|
||||
#define E1_ENABLE_INIT() NOOP
|
||||
#define E1_ENABLE_WRITE(STATE) stepperE1.toff((STATE)==E_ENABLE_ON ? chopper_timing_E1.toff : 0)
|
||||
#define E1_ENABLE_READ() stepperE1.isEnabled()
|
||||
@ -321,7 +321,7 @@ void reset_trinamic_drivers();
|
||||
#define CHOPPER_TIMING_E2 CHOPPER_TIMING_E
|
||||
#endif
|
||||
static constexpr chopper_timing_t chopper_timing_E2 = CHOPPER_TIMING_E2;
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2)
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE)
|
||||
#define E2_ENABLE_INIT() NOOP
|
||||
#define E2_ENABLE_WRITE(STATE) stepperE2.toff((STATE)==E_ENABLE_ON ? chopper_timing_E2.toff : 0)
|
||||
#define E2_ENABLE_READ() stepperE2.isEnabled()
|
||||
@ -338,7 +338,7 @@ void reset_trinamic_drivers();
|
||||
#define CHOPPER_TIMING_E3 CHOPPER_TIMING_E
|
||||
#endif
|
||||
static constexpr chopper_timing_t chopper_timing_E3 = CHOPPER_TIMING_E3;
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3)
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE)
|
||||
#define E3_ENABLE_INIT() NOOP
|
||||
#define E3_ENABLE_WRITE(STATE) stepperE3.toff((STATE)==E_ENABLE_ON ? chopper_timing_E3.toff : 0)
|
||||
#define E3_ENABLE_READ() stepperE3.isEnabled()
|
||||
@ -355,7 +355,7 @@ void reset_trinamic_drivers();
|
||||
#define CHOPPER_TIMING_E4 CHOPPER_TIMING_E
|
||||
#endif
|
||||
static constexpr chopper_timing_t chopper_timing_E4 = CHOPPER_TIMING_E4;
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4)
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE)
|
||||
#define E4_ENABLE_INIT() NOOP
|
||||
#define E4_ENABLE_WRITE(STATE) stepperE4.toff((STATE)==E_ENABLE_ON ? chopper_timing_E4.toff : 0)
|
||||
#define E4_ENABLE_READ() stepperE4.isEnabled()
|
||||
@ -372,7 +372,7 @@ void reset_trinamic_drivers();
|
||||
#define CHOPPER_TIMING_E5 CHOPPER_TIMING_E
|
||||
#endif
|
||||
static constexpr chopper_timing_t chopper_timing_E5 = CHOPPER_TIMING_E5;
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5)
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE)
|
||||
#define E5_ENABLE_INIT() NOOP
|
||||
#define E5_ENABLE_WRITE(STATE) stepperE5.toff((STATE)==E_ENABLE_ON ? chopper_timing_E5.toff : 0)
|
||||
#define E5_ENABLE_READ() stepperE5.isEnabled()
|
||||
@ -389,7 +389,7 @@ void reset_trinamic_drivers();
|
||||
#define CHOPPER_TIMING_E6 CHOPPER_TIMING_E
|
||||
#endif
|
||||
static constexpr chopper_timing_t chopper_timing_E6 = CHOPPER_TIMING_E6;
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6)
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE)
|
||||
#define E6_ENABLE_INIT() NOOP
|
||||
#define E6_ENABLE_WRITE(STATE) stepperE6.toff((STATE)==E_ENABLE_ON ? chopper_timing_E6.toff : 0)
|
||||
#define E6_ENABLE_READ() stepperE6.isEnabled()
|
||||
@ -406,7 +406,7 @@ void reset_trinamic_drivers();
|
||||
#define CHOPPER_TIMING_E7 CHOPPER_TIMING_E
|
||||
#endif
|
||||
static constexpr chopper_timing_t chopper_timing_E7 = CHOPPER_TIMING_E7;
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7)
|
||||
#if ENABLED(SOFTWARE_DRIVER_ENABLE)
|
||||
#define E7_ENABLE_INIT() NOOP
|
||||
#define E7_ENABLE_WRITE(STATE) stepperE7.toff((STATE)==E_ENABLE_ON ? chopper_timing_E7.toff : 0)
|
||||
#define E7_ENABLE_READ() stepperE7.isEnabled()
|
||||
|
Reference in New Issue
Block a user