💥 Num Axes and Multi-Stepper based on Driver Types (#24120)
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
@@ -67,11 +67,11 @@
|
||||
#define AXIS_DRIVER_TYPE_V(T) _AXIS_DRIVER_TYPE(V,T)
|
||||
#define AXIS_DRIVER_TYPE_W(T) _AXIS_DRIVER_TYPE(W,T)
|
||||
|
||||
#define AXIS_DRIVER_TYPE_X2(T) (EITHER(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE) && _AXIS_DRIVER_TYPE(X2,T))
|
||||
#define AXIS_DRIVER_TYPE_Y2(T) (ENABLED(Y_DUAL_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Y2,T))
|
||||
#define AXIS_DRIVER_TYPE_Z2(T) (NUM_Z_STEPPER_DRIVERS >= 2 && _AXIS_DRIVER_TYPE(Z2,T))
|
||||
#define AXIS_DRIVER_TYPE_Z3(T) (NUM_Z_STEPPER_DRIVERS >= 3 && _AXIS_DRIVER_TYPE(Z3,T))
|
||||
#define AXIS_DRIVER_TYPE_Z4(T) (NUM_Z_STEPPER_DRIVERS >= 4 && _AXIS_DRIVER_TYPE(Z4,T))
|
||||
#define AXIS_DRIVER_TYPE_X2(T) (HAS_X2_STEPPER && _AXIS_DRIVER_TYPE(X2,T))
|
||||
#define AXIS_DRIVER_TYPE_Y2(T) (HAS_DUAL_Y_STEPPERS && _AXIS_DRIVER_TYPE(Y2,T))
|
||||
#define AXIS_DRIVER_TYPE_Z2(T) (NUM_Z_STEPPERS >= 2 && _AXIS_DRIVER_TYPE(Z2,T))
|
||||
#define AXIS_DRIVER_TYPE_Z3(T) (NUM_Z_STEPPERS >= 3 && _AXIS_DRIVER_TYPE(Z3,T))
|
||||
#define AXIS_DRIVER_TYPE_Z4(T) (NUM_Z_STEPPERS >= 4 && _AXIS_DRIVER_TYPE(Z4,T))
|
||||
|
||||
#define AXIS_DRIVER_TYPE_E(N,T) (E_STEPPERS > N && _AXIS_DRIVER_TYPE(E##N,T))
|
||||
#define AXIS_DRIVER_TYPE_E0(T) AXIS_DRIVER_TYPE_E(0,T)
|
||||
|
||||
@@ -33,35 +33,35 @@
|
||||
|
||||
ZStepperAlign z_stepper_align;
|
||||
|
||||
xy_pos_t ZStepperAlign::xy[NUM_Z_STEPPER_DRIVERS];
|
||||
xy_pos_t ZStepperAlign::xy[NUM_Z_STEPPERS];
|
||||
|
||||
#if HAS_Z_STEPPER_ALIGN_STEPPER_XY
|
||||
xy_pos_t ZStepperAlign::stepper_xy[NUM_Z_STEPPER_DRIVERS];
|
||||
xy_pos_t ZStepperAlign::stepper_xy[NUM_Z_STEPPERS];
|
||||
#endif
|
||||
|
||||
void ZStepperAlign::reset_to_default() {
|
||||
#ifdef Z_STEPPER_ALIGN_XY
|
||||
|
||||
constexpr xy_pos_t xy_init[] = Z_STEPPER_ALIGN_XY;
|
||||
static_assert(COUNT(xy_init) == NUM_Z_STEPPER_DRIVERS,
|
||||
static_assert(COUNT(xy_init) == NUM_Z_STEPPERS,
|
||||
"Z_STEPPER_ALIGN_XY requires "
|
||||
#if NUM_Z_STEPPER_DRIVERS == 4
|
||||
#if NUM_Z_STEPPERS == 4
|
||||
"four {X,Y} entries (Z, Z2, Z3, and Z4)."
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 3
|
||||
#elif NUM_Z_STEPPERS == 3
|
||||
"three {X,Y} entries (Z, Z2, and Z3)."
|
||||
#else
|
||||
"two {X,Y} entries (Z and Z2)."
|
||||
#endif
|
||||
);
|
||||
|
||||
#define VALIDATE_ALIGN_POINT(N) static_assert(N >= NUM_Z_STEPPER_DRIVERS || Probe::build_time::can_reach(xy_init[N]), \
|
||||
#define VALIDATE_ALIGN_POINT(N) static_assert(N >= NUM_Z_STEPPERS || Probe::build_time::can_reach(xy_init[N]), \
|
||||
"Z_STEPPER_ALIGN_XY point " STRINGIFY(N) " is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.")
|
||||
VALIDATE_ALIGN_POINT(0); VALIDATE_ALIGN_POINT(1); VALIDATE_ALIGN_POINT(2); VALIDATE_ALIGN_POINT(3);
|
||||
|
||||
#else // !Z_STEPPER_ALIGN_XY
|
||||
|
||||
const xy_pos_t xy_init[] = {
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3 // First probe point...
|
||||
#if NUM_Z_STEPPERS >= 3 // First probe point...
|
||||
#if !Z_STEPPERS_ORIENTATION
|
||||
{ probe.min_x(), probe.min_y() }, // SW
|
||||
#elif Z_STEPPERS_ORIENTATION == 1
|
||||
@@ -73,7 +73,7 @@ void ZStepperAlign::reset_to_default() {
|
||||
#else
|
||||
#error "Z_STEPPERS_ORIENTATION must be from 0 to 3 (first point SW, NW, NE, SE)."
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS == 4 // 3 more points...
|
||||
#if NUM_Z_STEPPERS == 4 // 3 more points...
|
||||
#if !Z_STEPPERS_ORIENTATION
|
||||
{ probe.min_x(), probe.max_y() }, { probe.max_x(), probe.max_y() }, { probe.max_x(), probe.min_y() } // SW
|
||||
#elif Z_STEPPERS_ORIENTATION == 1
|
||||
@@ -106,11 +106,11 @@ void ZStepperAlign::reset_to_default() {
|
||||
#if HAS_Z_STEPPER_ALIGN_STEPPER_XY
|
||||
constexpr xy_pos_t stepper_xy_init[] = Z_STEPPER_ALIGN_STEPPER_XY;
|
||||
static_assert(
|
||||
COUNT(stepper_xy_init) == NUM_Z_STEPPER_DRIVERS,
|
||||
COUNT(stepper_xy_init) == NUM_Z_STEPPERS,
|
||||
"Z_STEPPER_ALIGN_STEPPER_XY requires "
|
||||
#if NUM_Z_STEPPER_DRIVERS == 4
|
||||
#if NUM_Z_STEPPERS == 4
|
||||
"four {X,Y} entries (Z, Z2, Z3, and Z4)."
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 3
|
||||
#elif NUM_Z_STEPPERS == 3
|
||||
"three {X,Y} entries (Z, Z2, and Z3)."
|
||||
#endif
|
||||
);
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
|
||||
class ZStepperAlign {
|
||||
public:
|
||||
static xy_pos_t xy[NUM_Z_STEPPER_DRIVERS];
|
||||
static xy_pos_t xy[NUM_Z_STEPPERS];
|
||||
|
||||
#if HAS_Z_STEPPER_ALIGN_STEPPER_XY
|
||||
static xy_pos_t stepper_xy[NUM_Z_STEPPER_DRIVERS];
|
||||
static xy_pos_t stepper_xy[NUM_Z_STEPPERS];
|
||||
#endif
|
||||
|
||||
static void reset_to_default();
|
||||
|
||||
@@ -91,7 +91,7 @@ void GcodeSuite::G34() {
|
||||
digipot_i2c.set_current(Z_AXIS, target_current)
|
||||
#elif HAS_TRINAMIC_CONFIG
|
||||
const uint16_t target_current = parser.intval('S', GANTRY_CALIBRATION_CURRENT);
|
||||
static uint16_t previous_current_arr[NUM_Z_STEPPER_DRIVERS];
|
||||
static uint16_t previous_current_arr[NUM_Z_STEPPERS];
|
||||
#if AXIS_IS_TMC(Z)
|
||||
previous_current_arr[0] = stepperZ.getMilliamps();
|
||||
stepperZ.rms_current(target_current);
|
||||
|
||||
@@ -52,9 +52,9 @@
|
||||
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
#include "../../core/debug_out.h"
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
#define TRIPLE_Z 1
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
#define QUAD_Z 1
|
||||
#endif
|
||||
#endif
|
||||
@@ -180,11 +180,11 @@ void GcodeSuite::G34() {
|
||||
// This hack is un-done at the end of G34 - either by re-homing, or by using the probed heights of the last iteration.
|
||||
|
||||
#if !HAS_Z_STEPPER_ALIGN_STEPPER_XY
|
||||
float last_z_align_move[NUM_Z_STEPPER_DRIVERS] = ARRAY_N_1(NUM_Z_STEPPER_DRIVERS, 10000.0f);
|
||||
float last_z_align_move[NUM_Z_STEPPERS] = ARRAY_N_1(NUM_Z_STEPPERS, 10000.0f);
|
||||
#else
|
||||
float last_z_align_level_indicator = 10000.0f;
|
||||
#endif
|
||||
float z_measured[NUM_Z_STEPPER_DRIVERS] = { 0 },
|
||||
float z_measured[NUM_Z_STEPPERS] = { 0 },
|
||||
z_maxdiff = 0.0f,
|
||||
amplification = z_auto_align_amplification;
|
||||
|
||||
@@ -217,9 +217,9 @@ void GcodeSuite::G34() {
|
||||
float z_measured_max = -100000.0f;
|
||||
|
||||
// Probe all positions (one per Z-Stepper)
|
||||
LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) {
|
||||
LOOP_L_N(i, NUM_Z_STEPPERS) {
|
||||
// iteration odd/even --> downward / upward stepper sequence
|
||||
const uint8_t iprobe = (iteration & 1) ? NUM_Z_STEPPER_DRIVERS - 1 - i : i;
|
||||
const uint8_t iprobe = (iteration & 1) ? NUM_Z_STEPPERS - 1 - i : i;
|
||||
|
||||
// Safe clearance even on an incline
|
||||
if ((iteration == 0 || i > 0) && z_probe > current_position.z) do_blocking_move_to_z(z_probe);
|
||||
@@ -270,20 +270,20 @@ void GcodeSuite::G34() {
|
||||
// This allows the actual adjustment logic to be shared by both algorithms.
|
||||
linear_fit_data lfd;
|
||||
incremental_LSF_reset(&lfd);
|
||||
LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) {
|
||||
LOOP_L_N(i, NUM_Z_STEPPERS) {
|
||||
SERIAL_ECHOLNPGM("PROBEPT_", i, ": ", z_measured[i]);
|
||||
incremental_LSF(&lfd, z_stepper_align.xy[i], z_measured[i]);
|
||||
}
|
||||
finish_incremental_LSF(&lfd);
|
||||
|
||||
z_measured_min = 100000.0f;
|
||||
LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) {
|
||||
LOOP_L_N(i, NUM_Z_STEPPERS) {
|
||||
z_measured[i] = -(lfd.A * z_stepper_align.stepper_xy[i].x + lfd.B * z_stepper_align.stepper_xy[i].y + lfd.D);
|
||||
z_measured_min = _MIN(z_measured_min, z_measured[i]);
|
||||
}
|
||||
|
||||
SERIAL_ECHOLNPGM(
|
||||
LIST_N(DOUBLE(NUM_Z_STEPPER_DRIVERS),
|
||||
LIST_N(DOUBLE(NUM_Z_STEPPERS),
|
||||
"Calculated Z1=", z_measured[0],
|
||||
" Z2=", z_measured[1],
|
||||
" Z3=", z_measured[2],
|
||||
@@ -307,7 +307,7 @@ void GcodeSuite::G34() {
|
||||
|
||||
#if HAS_STATUS_MESSAGE
|
||||
char fstr1[10];
|
||||
char msg[6 + (6 + 5) * NUM_Z_STEPPER_DRIVERS + 1]
|
||||
char msg[6 + (6 + 5) * NUM_Z_STEPPERS + 1]
|
||||
#if TRIPLE_Z
|
||||
, fstr2[10], fstr3[10]
|
||||
#if QUAD_Z
|
||||
@@ -345,12 +345,12 @@ void GcodeSuite::G34() {
|
||||
|
||||
// Calculate mean value as a reference
|
||||
float z_measured_mean = 0.0f;
|
||||
LOOP_L_N(zstepper, NUM_Z_STEPPER_DRIVERS) z_measured_mean += z_measured[zstepper];
|
||||
z_measured_mean /= NUM_Z_STEPPER_DRIVERS;
|
||||
LOOP_L_N(zstepper, NUM_Z_STEPPERS) z_measured_mean += z_measured[zstepper];
|
||||
z_measured_mean /= NUM_Z_STEPPERS;
|
||||
|
||||
// Calculate the sum of the absolute deviations from the mean value
|
||||
float z_align_level_indicator = 0.0f;
|
||||
LOOP_L_N(zstepper, NUM_Z_STEPPER_DRIVERS)
|
||||
LOOP_L_N(zstepper, NUM_Z_STEPPERS)
|
||||
z_align_level_indicator += ABS(z_measured[zstepper] - z_measured_mean);
|
||||
|
||||
// If it's getting worse, stop and throw an error
|
||||
@@ -365,7 +365,7 @@ void GcodeSuite::G34() {
|
||||
|
||||
bool success_break = true;
|
||||
// Correct the individual stepper offsets
|
||||
LOOP_L_N(zstepper, NUM_Z_STEPPER_DRIVERS) {
|
||||
LOOP_L_N(zstepper, NUM_Z_STEPPERS) {
|
||||
// Calculate current stepper move
|
||||
float z_align_move = z_measured[zstepper] - z_measured_min;
|
||||
const float z_align_abs = ABS(z_align_move);
|
||||
@@ -515,9 +515,9 @@ void GcodeSuite::M422() {
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!WITHIN(position_index, 1, NUM_Z_STEPPER_DRIVERS)) {
|
||||
if (!WITHIN(position_index, 1, NUM_Z_STEPPERS)) {
|
||||
SERIAL_ECHOF(err_string);
|
||||
SERIAL_ECHOLNPGM(" index invalid (1.." STRINGIFY(NUM_Z_STEPPER_DRIVERS) ").");
|
||||
SERIAL_ECHOLNPGM(" index invalid (1.." STRINGIFY(NUM_Z_STEPPERS) ").");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -544,7 +544,7 @@ void GcodeSuite::M422() {
|
||||
|
||||
void GcodeSuite::M422_report(const bool forReplay/*=true*/) {
|
||||
report_heading(forReplay, F(STR_Z_AUTO_ALIGN));
|
||||
LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) {
|
||||
LOOP_L_N(i, NUM_Z_STEPPERS) {
|
||||
report_echo_start(forReplay);
|
||||
SERIAL_ECHOLNPGM_P(
|
||||
PSTR(" M422 S"), i + 1,
|
||||
@@ -553,7 +553,7 @@ void GcodeSuite::M422_report(const bool forReplay/*=true*/) {
|
||||
);
|
||||
}
|
||||
#if HAS_Z_STEPPER_ALIGN_STEPPER_XY
|
||||
LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) {
|
||||
LOOP_L_N(i, NUM_Z_STEPPERS) {
|
||||
report_echo_start(forReplay);
|
||||
SERIAL_ECHOLNPGM_P(
|
||||
PSTR(" M422 W"), i + 1,
|
||||
|
||||
@@ -93,12 +93,12 @@
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
if (parser.seenval('Z')) {
|
||||
const float z_adj = parser.value_linear_units();
|
||||
#if NUM_Z_STEPPER_DRIVERS == 2
|
||||
#if NUM_Z_STEPPERS == 2
|
||||
endstops.z2_endstop_adj = z_adj;
|
||||
#else
|
||||
const int ind = parser.intval('S');
|
||||
#define _SET_ZADJ(N) if (!ind || ind == N) endstops.z##N##_endstop_adj = z_adj;
|
||||
REPEAT_S(2, INCREMENT(NUM_Z_STEPPER_DRIVERS), _SET_ZADJ)
|
||||
REPEAT_S(2, INCREMENT(NUM_Z_STEPPERS), _SET_ZADJ)
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
@@ -114,11 +114,11 @@
|
||||
SERIAL_ECHOLNPGM_P(SP_Y_STR, LINEAR_UNIT(endstops.y2_endstop_adj));
|
||||
#endif
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
SERIAL_ECHOPGM(" S2 Z", LINEAR_UNIT(endstops.z3_endstop_adj));
|
||||
report_echo_start(forReplay);
|
||||
SERIAL_ECHOPGM(" M666 S3 Z", LINEAR_UNIT(endstops.z3_endstop_adj));
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
report_echo_start(forReplay);
|
||||
SERIAL_ECHOPGM(" M666 S4 Z", LINEAR_UNIT(endstops.z4_endstop_adj));
|
||||
#endif
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "../../../module/tool_change.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_PRUSA_MMU2)
|
||||
#if HAS_PRUSA_MMU2
|
||||
#include "../../../feature/mmu/mmu2.h"
|
||||
#if ENABLED(MMU2_MENUS)
|
||||
#include "../../../lcd/menu/menu_mmu2.h"
|
||||
|
||||
@@ -707,6 +707,15 @@
|
||||
#define HAS_Y_AXIS 1
|
||||
#if NUM_AXES >= XYZ
|
||||
#define HAS_Z_AXIS 1
|
||||
#ifdef Z4_DRIVER_TYPE
|
||||
#define NUM_Z_STEPPERS 4
|
||||
#elif defined(Z3_DRIVER_TYPE)
|
||||
#define NUM_Z_STEPPERS 3
|
||||
#elif defined(Z2_DRIVER_TYPE)
|
||||
#define NUM_Z_STEPPERS 2
|
||||
#else
|
||||
#define NUM_Z_STEPPERS 1
|
||||
#endif
|
||||
#if NUM_AXES >= 4
|
||||
#define HAS_I_AXIS 1
|
||||
#if NUM_AXES >= 5
|
||||
@@ -869,6 +878,15 @@
|
||||
#undef MANUAL_W_HOME_POS
|
||||
#endif
|
||||
|
||||
#ifdef X2_DRIVER_TYPE
|
||||
#define HAS_X2_STEPPER 1
|
||||
// Dual X Carriage isn't known yet. TODO: Consider moving it to Configuration.h.
|
||||
#endif
|
||||
#ifdef Y2_DRIVER_TYPE
|
||||
#define HAS_Y2_STEPPER 1
|
||||
#define HAS_DUAL_Y_STEPPERS 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Number of Primary Linear Axes (e.g., XYZ)
|
||||
* X, XY, or XYZ axes. Excluding duplicate axes (X2, Y2. Z2. Z3, Z4)
|
||||
|
||||
@@ -650,33 +650,20 @@
|
||||
#endif
|
||||
|
||||
// Multiple Z steppers
|
||||
#ifndef NUM_Z_STEPPER_DRIVERS
|
||||
#define NUM_Z_STEPPER_DRIVERS 1
|
||||
#endif
|
||||
|
||||
// Fallback Stepper Driver types that depend on Configuration_adv.h
|
||||
#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
|
||||
#define HAS_X2_STEPPER 1
|
||||
#else
|
||||
#undef X2_DRIVER_TYPE
|
||||
#endif
|
||||
#if DISABLED(Y_DUAL_STEPPER_DRIVERS)
|
||||
#undef Y2_DRIVER_TYPE
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS < 4
|
||||
#undef Z4_DRIVER_TYPE
|
||||
#if NUM_Z_STEPPERS < 4
|
||||
#undef INVERT_Z4_VS_Z_DIR
|
||||
#if NUM_Z_STEPPER_DRIVERS < 3
|
||||
#undef Z3_DRIVER_TYPE
|
||||
#if NUM_Z_STEPPERS < 3
|
||||
#undef INVERT_Z3_VS_Z_DIR
|
||||
#if NUM_Z_STEPPER_DRIVERS < 2
|
||||
#undef Z2_DRIVER_TYPE
|
||||
#if NUM_Z_STEPPERS < 2
|
||||
#undef INVERT_Z2_VS_Z_DIR
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(X2_DRIVER_TYPE) && DISABLED(DUAL_X_CARRIAGE)
|
||||
#define HAS_DUAL_X_STEPPERS 1
|
||||
#endif
|
||||
|
||||
//
|
||||
// Spindle/Laser power display types
|
||||
// Defined here so sanity checks can use them
|
||||
@@ -956,7 +943,7 @@
|
||||
#undef HOME_Z_FIRST
|
||||
#undef HOMING_Z_WITH_PROBE
|
||||
#undef ENABLE_LEVELING_FADE_HEIGHT
|
||||
#undef NUM_Z_STEPPER_DRIVERS
|
||||
#undef NUM_Z_STEPPERS
|
||||
#undef CNC_WORKSPACE_PLANES
|
||||
#if NUM_AXES < 2
|
||||
#undef STEALTHCHOP_Y
|
||||
|
||||
@@ -1234,7 +1234,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
#if Z_HOME_TO_MAX
|
||||
#ifndef Z3_MAX_ENDSTOP_INVERTING
|
||||
#if Z3_USE_ENDSTOP == _XMIN_
|
||||
@@ -1366,7 +1366,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
#if Z_HOME_TO_MAX
|
||||
#ifndef Z4_MAX_ENDSTOP_INVERTING
|
||||
#if Z4_USE_ENDSTOP == _XMIN_
|
||||
@@ -1675,7 +1675,7 @@
|
||||
#undef DISABLE_INACTIVE_Z
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 2
|
||||
#if NUM_Z_STEPPERS >= 2
|
||||
#if PIN_EXISTS(Z2_ENABLE) || AXIS_IS_L64XX(Z2) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2))
|
||||
#define HAS_Z2_ENABLE 1
|
||||
#endif
|
||||
@@ -1690,7 +1690,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
#if PIN_EXISTS(Z3_ENABLE) || AXIS_IS_L64XX(Z3) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3))
|
||||
#define HAS_Z3_ENABLE 1
|
||||
#endif
|
||||
@@ -1705,7 +1705,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
#if PIN_EXISTS(Z4_ENABLE) || AXIS_IS_L64XX(Z4) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4))
|
||||
#define HAS_Z4_ENABLE 1
|
||||
#endif
|
||||
@@ -2080,7 +2080,7 @@
|
||||
#ifndef Y_SLAVE_ADDRESS
|
||||
#define Y_SLAVE_ADDRESS 0
|
||||
#endif
|
||||
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
|
||||
#if HAS_DUAL_Y_STEPPERS
|
||||
#if defined(Y2_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y2)
|
||||
#define Y2_SENSORLESS 1
|
||||
#endif
|
||||
@@ -2127,7 +2127,7 @@
|
||||
#ifndef Z_SLAVE_ADDRESS
|
||||
#define Z_SLAVE_ADDRESS 0
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 2
|
||||
#if NUM_Z_STEPPERS >= 2
|
||||
#if defined(Z2_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2)
|
||||
#define Z2_SENSORLESS 1
|
||||
#endif
|
||||
@@ -2144,7 +2144,7 @@
|
||||
#define Z2_SLAVE_ADDRESS 0
|
||||
#endif
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
#if defined(Z3_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z3)
|
||||
#define Z3_SENSORLESS 1
|
||||
#endif
|
||||
@@ -2161,7 +2161,7 @@
|
||||
#define Z3_SLAVE_ADDRESS 0
|
||||
#endif
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
#if defined(Z4_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z4)
|
||||
#define Z4_SENSORLESS 1
|
||||
#endif
|
||||
@@ -2542,8 +2542,8 @@
|
||||
#define IS_X2_ENDSTOP(A,M) (ENABLED(X_DUAL_ENDSTOPS) && X2_USE_ENDSTOP == _##A##M##_)
|
||||
#define IS_Y2_ENDSTOP(A,M) (ENABLED(Y_DUAL_ENDSTOPS) && Y2_USE_ENDSTOP == _##A##M##_)
|
||||
#define IS_Z2_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && Z2_USE_ENDSTOP == _##A##M##_)
|
||||
#define IS_Z3_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 && Z3_USE_ENDSTOP == _##A##M##_)
|
||||
#define IS_Z4_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 && Z4_USE_ENDSTOP == _##A##M##_)
|
||||
#define IS_Z3_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 3 && Z3_USE_ENDSTOP == _##A##M##_)
|
||||
#define IS_Z4_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 4 && Z4_USE_ENDSTOP == _##A##M##_)
|
||||
|
||||
#define _HAS_STOP(A,M) (PIN_EXISTS(A##_##M) && !IS_PROBE_PIN(A,M) && !IS_X2_ENDSTOP(A,M) && !IS_Y2_ENDSTOP(A,M) && !IS_Z2_ENDSTOP(A,M) && !IS_Z3_ENDSTOP(A,M) && !IS_Z4_ENDSTOP(A,M))
|
||||
#if _HAS_STOP(X,MIN)
|
||||
|
||||
@@ -524,11 +524,11 @@
|
||||
#elif defined(Z_QUAD_ENDSTOPS_ADJUSTMENT2) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT3) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT4)
|
||||
#error "Z_QUAD_ENDSTOPS_ADJUSTMENT[234] is now Z[234]_ENDSTOP_ADJUSTMENT."
|
||||
#elif defined(Z_DUAL_STEPPER_DRIVERS)
|
||||
#error "Z_DUAL_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 2."
|
||||
#error "Z_DUAL_STEPPER_DRIVERS is no longer needed and should be removed."
|
||||
#elif defined(Z_TRIPLE_STEPPER_DRIVERS)
|
||||
#error "Z_TRIPLE_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 3."
|
||||
#error "Z_TRIPLE_STEPPER_DRIVERS is no longer needed and should be removed."
|
||||
#elif defined(Z_QUAD_STEPPER_DRIVERS)
|
||||
#error "Z_QUAD_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 4."
|
||||
#error "Z_QUAD_STEPPER_DRIVERS is no longer needed and should be removed."
|
||||
#elif defined(Z_DUAL_ENDSTOPS) || defined(Z_TRIPLE_ENDSTOPS) || defined(Z_QUAD_ENDSTOPS)
|
||||
#error "Z_(DUAL|TRIPLE|QUAD)_ENDSTOPS is now Z_MULTI_ENDSTOPS."
|
||||
#elif defined(DUGS_UI_MOVE_DIS_OPTION)
|
||||
@@ -621,6 +621,12 @@
|
||||
#error "DWIN_CREALITY_LCD_ENHANCED is now DWIN_LCD_PROUI."
|
||||
#elif defined(LINEAR_AXES)
|
||||
#error "LINEAR_AXES is now NUM_AXES (to account for rotational axes)."
|
||||
#elif defined(X_DUAL_STEPPER_DRIVERS)
|
||||
#error "X_DUAL_STEPPER_DRIVERS is no longer needed and should be removed."
|
||||
#elif defined(Y_DUAL_STEPPER_DRIVERS)
|
||||
#error "Y_DUAL_STEPPER_DRIVERS is no longer needed and should be removed."
|
||||
#elif defined(NUM_Z_STEPPER_DRIVERS)
|
||||
#error "NUM_Z_STEPPER_DRIVERS is no longer needed and should be removed."
|
||||
#endif
|
||||
|
||||
constexpr float arm[] = AXIS_RELATIVE_MODES;
|
||||
@@ -737,27 +743,21 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
|
||||
* Multiple Stepper Drivers Per Axis
|
||||
*/
|
||||
#define GOOD_AXIS_PINS(A) (HAS_##A##_ENABLE && HAS_##A##_STEP && HAS_##A##_DIR)
|
||||
#if ENABLED(X_DUAL_STEPPER_DRIVERS)
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
#error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS."
|
||||
#elif !GOOD_AXIS_PINS(X)
|
||||
#error "X_DUAL_STEPPER_DRIVERS requires X2 pins to be defined."
|
||||
#endif
|
||||
#if HAS_X2_STEPPER && !GOOD_AXIS_PINS(X)
|
||||
#error "If X2_DRIVER_TYPE is defined, then X2 ENABLE/STEP/DIR pins are also needed."
|
||||
#endif
|
||||
|
||||
#if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !GOOD_AXIS_PINS(Y)
|
||||
#error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins to be defined."
|
||||
#if HAS_DUAL_Y_STEPPERS && !GOOD_AXIS_PINS(Y)
|
||||
#error "If Y2_DRIVER_TYPE is defined, then Y2 ENABLE/STEP/DIR pins are also needed."
|
||||
#endif
|
||||
|
||||
#if HAS_Z_AXIS
|
||||
#if !WITHIN(NUM_Z_STEPPER_DRIVERS, 1, 4)
|
||||
#error "NUM_Z_STEPPER_DRIVERS must be an integer from 1 to 4."
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 2 && !GOOD_AXIS_PINS(Z2)
|
||||
#error "If NUM_Z_STEPPER_DRIVERS is 2, you must define stepper pins for Z2."
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 3 && !(GOOD_AXIS_PINS(Z2) && GOOD_AXIS_PINS(Z3))
|
||||
#error "If NUM_Z_STEPPER_DRIVERS is 3, you must define stepper pins for Z2 and Z3."
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 4 && !(GOOD_AXIS_PINS(Z2) && GOOD_AXIS_PINS(Z3) && GOOD_AXIS_PINS(Z4))
|
||||
#error "If NUM_Z_STEPPER_DRIVERS is 4, you must define stepper pins for Z2, Z3, and Z4."
|
||||
#if NUM_Z_STEPPERS >= 2 && !GOOD_AXIS_PINS(Z2)
|
||||
#error "If Z2_DRIVER_TYPE is defined, then Z2 ENABLE/STEP/DIR pins are also needed."
|
||||
#elif NUM_Z_STEPPERS >= 3 && !GOOD_AXIS_PINS(Z3)
|
||||
#error "If Z3_DRIVER_TYPE is defined, then Z3 ENABLE/STEP/DIR pins are also needed."
|
||||
#elif NUM_Z_STEPPERS >= 4 && !GOOD_AXIS_PINS(Z4)
|
||||
#error "If Z4_DRIVER_TYPE is defined, then Z4 ENABLE/STEP/DIR pins are also needed."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2637,10 +2637,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#error "Z_MULTI_ENDSTOPS is not compatible with DELTA."
|
||||
#elif !Z2_USE_ENDSTOP
|
||||
#error "Z2_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS."
|
||||
#elif !Z3_USE_ENDSTOP && NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#error "Z3_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS and NUM_Z_STEPPER_DRIVERS >= 3."
|
||||
#elif !Z4_USE_ENDSTOP && NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#error "Z4_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS and NUM_Z_STEPPER_DRIVERS >= 4."
|
||||
#elif !Z3_USE_ENDSTOP && NUM_Z_STEPPERS >= 3
|
||||
#error "Z3_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS and Z3_DRIVER_TYPE."
|
||||
#elif !Z4_USE_ENDSTOP && NUM_Z_STEPPERS >= 4
|
||||
#error "Z4_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS and Z4_DRIVER_TYPE."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -3701,14 +3701,14 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
|
||||
#endif
|
||||
|
||||
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
|
||||
#if NUM_Z_STEPPER_DRIVERS <= 1
|
||||
#error "Z_STEPPER_AUTO_ALIGN requires NUM_Z_STEPPER_DRIVERS greater than 1."
|
||||
#if NUM_Z_STEPPERS <= 1
|
||||
#error "Z_STEPPER_AUTO_ALIGN requires more than one Z stepper."
|
||||
#elif !HAS_BED_PROBE
|
||||
#error "Z_STEPPER_AUTO_ALIGN requires a Z-bed probe."
|
||||
#elif HAS_Z_STEPPER_ALIGN_STEPPER_XY
|
||||
static_assert(WITHIN(Z_STEPPER_ALIGN_AMP, 0.5, 2.0), "Z_STEPPER_ALIGN_AMP must be between 0.5 and 2.0.");
|
||||
#if NUM_Z_STEPPER_DRIVERS < 3
|
||||
#error "Z_STEPPER_ALIGN_STEPPER_XY requires NUM_Z_STEPPER_DRIVERS to be 3 or 4."
|
||||
#if NUM_Z_STEPPERS < 3
|
||||
#error "Z_STEPPER_ALIGN_STEPPER_XY requires 3 or 4 Z steppers."
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2090,7 +2090,7 @@ void SetPID(celsius_t t, heater_id_t h) {
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(HAS_COLOR_LEDS)
|
||||
#if HAS_COLOR_LEDS
|
||||
void LiveLedColorR() { leds.color.r = MenuData.Value; HMI_data.Led_Color = leds.color; leds.update(); }
|
||||
void SetLedColorR() { SetIntOnClick(0, 255, leds.color.r, nullptr, LiveLedColorR); }
|
||||
void LiveLedColorG() { leds.color.g = MenuData.Value; HMI_data.Led_Color = leds.color; leds.update(); }
|
||||
@@ -3260,7 +3260,7 @@ void Draw_GetColor_Menu() {
|
||||
#if !BOTH(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL)
|
||||
MENU_ITEM(ICON_LedControl, GET_TEXT_F(MSG_LEDS), onDrawLedStatus, SetLedStatus);
|
||||
#endif
|
||||
#if (HAS_COLOR_LEDS)
|
||||
#if HAS_COLOR_LEDS
|
||||
EDIT_ITEM(ICON_LedControl, GET_TEXT_F(MSG_COLORS_RED), onDrawPInt8Menu, SetLedColorR, &leds.color.r);
|
||||
EDIT_ITEM(ICON_LedControl, GET_TEXT_F(MSG_COLORS_GREEN), onDrawPInt8Menu, SetLedColorG, &leds.color.g);
|
||||
EDIT_ITEM(ICON_LedControl, GET_TEXT_F(MSG_COLORS_BLUE), onDrawPInt8Menu, SetLedColorB, &leds.color.b);
|
||||
|
||||
@@ -69,8 +69,8 @@ uint8_t L64XX_Marlin::dir_commands[MAX_L64XX]; // array to hold direction comma
|
||||
#define _EN_ITEM(N) , ENABLED(INVERT_E##N##_DIR)
|
||||
const uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = {
|
||||
NUM_AXIS_LIST(ENABLED(INVERT_X_DIR), ENABLED(INVERT_Y_DIR), ENABLED(INVERT_Z_DIR), ENABLED(INVERT_I_DIR), ENABLED(INVERT_J_DIR), ENABLED(INVERT_K_DIR), ENABLED(INVERT_U_DIR), ENABLED(INVERT_V_DIR), ENABLED(INVERT_W_DIR))
|
||||
, ENABLED(INVERT_X_DIR) ^ BOTH(X_DUAL_STEPPER_DRIVERS, INVERT_X2_VS_X_DIR) // X2
|
||||
, ENABLED(INVERT_Y_DIR) ^ BOTH(Y_DUAL_STEPPER_DRIVERS, INVERT_Y2_VS_Y_DIR) // Y2
|
||||
, ENABLED(INVERT_X_DIR) ^ BOTH(HAS_DUAL_X_STEPPERS, INVERT_X2_VS_X_DIR) // X2
|
||||
, ENABLED(INVERT_Y_DIR) ^ BOTH(HAS_DUAL_Y_STEPPERS, INVERT_Y2_VS_Y_DIR) // Y2
|
||||
, ENABLED(INVERT_Z_DIR) ^ ENABLED(INVERT_Z2_VS_Z_DIR) // Z2
|
||||
, ENABLED(INVERT_Z_DIR) ^ ENABLED(INVERT_Z3_VS_Z_DIR) // Z3
|
||||
, ENABLED(INVERT_Z_DIR) ^ ENABLED(INVERT_Z4_VS_Z_DIR) // Z4
|
||||
|
||||
@@ -78,9 +78,9 @@ Endstops::endstop_mask_t Endstops::live_state = 0;
|
||||
#endif
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
float Endstops::z2_endstop_adj;
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
float Endstops::z3_endstop_adj;
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
float Endstops::z4_endstop_adj;
|
||||
#endif
|
||||
#endif
|
||||
@@ -792,14 +792,14 @@ void Endstops::update() {
|
||||
#else
|
||||
COPY_LIVE_STATE(Z_MIN, Z2_MIN);
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
#if HAS_Z3_MIN
|
||||
UPDATE_ENDSTOP_BIT(Z3, MIN);
|
||||
#else
|
||||
COPY_LIVE_STATE(Z_MIN, Z3_MIN);
|
||||
#endif
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
#if HAS_Z4_MIN
|
||||
UPDATE_ENDSTOP_BIT(Z4, MIN);
|
||||
#else
|
||||
@@ -824,14 +824,14 @@ void Endstops::update() {
|
||||
#else
|
||||
COPY_LIVE_STATE(Z_MAX, Z2_MAX);
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
#if HAS_Z3_MAX
|
||||
UPDATE_ENDSTOP_BIT(Z3, MAX);
|
||||
#else
|
||||
COPY_LIVE_STATE(Z_MAX, Z3_MAX);
|
||||
#endif
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
#if HAS_Z4_MAX
|
||||
UPDATE_ENDSTOP_BIT(Z4, MAX);
|
||||
#else
|
||||
@@ -1090,9 +1090,9 @@ void Endstops::update() {
|
||||
|
||||
#if DISABLED(Z_MULTI_ENDSTOPS)
|
||||
#define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_ENDSTOP(Z, MINMAX)
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 4
|
||||
#elif NUM_Z_STEPPERS == 4
|
||||
#define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_QUAD_ENDSTOP(Z, MINMAX)
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 3
|
||||
#elif NUM_Z_STEPPERS == 3
|
||||
#define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_TRIPLE_ENDSTOP(Z, MINMAX)
|
||||
#else
|
||||
#define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_DUAL_ENDSTOP(Z, MINMAX)
|
||||
|
||||
@@ -64,11 +64,11 @@ enum EndstopEnum : char {
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
_ES_ITEM(HAS_Z_MIN, Z2_MIN)
|
||||
_ES_ITEM(HAS_Z_MAX, Z2_MAX)
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
_ES_ITEM(HAS_Z_MIN, Z3_MIN)
|
||||
_ES_ITEM(HAS_Z_MAX, Z3_MAX)
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
_ES_ITEM(HAS_Z_MIN, Z4_MIN)
|
||||
_ES_ITEM(HAS_Z_MAX, Z4_MAX)
|
||||
#endif
|
||||
@@ -120,10 +120,10 @@ class Endstops {
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
static float z2_endstop_adj;
|
||||
#endif
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 3
|
||||
static float z3_endstop_adj;
|
||||
#endif
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 4
|
||||
static float z4_endstop_adj;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2038,7 +2038,7 @@ void prepare_line_to_destination() {
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
if (axis == Z_AXIS) {
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS == 2
|
||||
#if NUM_Z_STEPPERS == 2
|
||||
|
||||
const float adj = ABS(endstops.z2_endstop_adj);
|
||||
if (adj) {
|
||||
@@ -2056,13 +2056,13 @@ void prepare_line_to_destination() {
|
||||
|
||||
adjustFunc_t lock[] = {
|
||||
stepper.set_z1_lock, stepper.set_z2_lock, stepper.set_z3_lock
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
, stepper.set_z4_lock
|
||||
#endif
|
||||
};
|
||||
float adj[] = {
|
||||
0, endstops.z2_endstop_adj, endstops.z3_endstop_adj
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
, endstops.z4_endstop_adj
|
||||
#endif
|
||||
};
|
||||
@@ -2081,7 +2081,7 @@ void prepare_line_to_destination() {
|
||||
lock[1] = lock[2], adj[1] = adj[2];
|
||||
lock[2] = tempLock, adj[2] = tempAdj;
|
||||
}
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
if (adj[3] < adj[2]) {
|
||||
tempLock = lock[2], tempAdj = adj[2];
|
||||
lock[2] = lock[3], adj[2] = adj[3];
|
||||
@@ -2106,14 +2106,14 @@ void prepare_line_to_destination() {
|
||||
// lock the second stepper for the final correction
|
||||
(*lock[1])(true);
|
||||
do_homing_move(axis, adj[2] - adj[1]);
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
// lock the third stepper for the final correction
|
||||
(*lock[2])(true);
|
||||
do_homing_move(axis, adj[3] - adj[2]);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
(*lock[3])(true);
|
||||
do_homing_move(axis, adj[2] - adj[3]);
|
||||
#endif
|
||||
@@ -2126,7 +2126,7 @@ void prepare_line_to_destination() {
|
||||
stepper.set_z1_lock(false);
|
||||
stepper.set_z2_lock(false);
|
||||
stepper.set_z3_lock(false);
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
stepper.set_z4_lock(false);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -347,9 +347,9 @@ typedef struct SettingsDataStruct {
|
||||
// Z_STEPPER_AUTO_ALIGN, HAS_Z_STEPPER_ALIGN_STEPPER_XY
|
||||
//
|
||||
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
|
||||
xy_pos_t z_stepper_align_xy[NUM_Z_STEPPER_DRIVERS]; // M422 S X Y
|
||||
xy_pos_t z_stepper_align_xy[NUM_Z_STEPPERS]; // M422 S X Y
|
||||
#if HAS_Z_STEPPER_ALIGN_STEPPER_XY
|
||||
xy_pos_t z_stepper_align_stepper_xy[NUM_Z_STEPPER_DRIVERS]; // M422 W X Y
|
||||
xy_pos_t z_stepper_align_stepper_xy[NUM_Z_STEPPERS]; // M422 W X Y
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1017,13 +1017,13 @@ void MarlinSettings::postprocess() {
|
||||
EEPROM_WRITE(TERN(Y_DUAL_ENDSTOPS, endstops.y2_endstop_adj, dummyf)); // 1 float
|
||||
EEPROM_WRITE(TERN(Z_MULTI_ENDSTOPS, endstops.z2_endstop_adj, dummyf)); // 1 float
|
||||
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 3
|
||||
EEPROM_WRITE(endstops.z3_endstop_adj); // 1 float
|
||||
#else
|
||||
EEPROM_WRITE(dummyf);
|
||||
#endif
|
||||
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 4
|
||||
EEPROM_WRITE(endstops.z4_endstop_adj); // 1 float
|
||||
#else
|
||||
EEPROM_WRITE(dummyf);
|
||||
@@ -1969,12 +1969,12 @@ void MarlinSettings::postprocess() {
|
||||
EEPROM_READ(TERN(Y_DUAL_ENDSTOPS, endstops.y2_endstop_adj, dummyf)); // 1 float
|
||||
EEPROM_READ(TERN(Z_MULTI_ENDSTOPS, endstops.z2_endstop_adj, dummyf)); // 1 float
|
||||
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 3
|
||||
EEPROM_READ(endstops.z3_endstop_adj); // 1 float
|
||||
#else
|
||||
EEPROM_READ(dummyf);
|
||||
#endif
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 4
|
||||
EEPROM_READ(endstops.z4_endstop_adj); // 1 float
|
||||
#else
|
||||
EEPROM_READ(dummyf);
|
||||
@@ -3042,13 +3042,13 @@ void MarlinSettings::reset() {
|
||||
#define Z2_ENDSTOP_ADJUSTMENT 0
|
||||
#endif
|
||||
endstops.z2_endstop_adj = Z2_ENDSTOP_ADJUSTMENT;
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
#ifndef Z3_ENDSTOP_ADJUSTMENT
|
||||
#define Z3_ENDSTOP_ADJUSTMENT 0
|
||||
#endif
|
||||
endstops.z3_endstop_adj = Z3_ENDSTOP_ADJUSTMENT;
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
#ifndef Z4_ENDSTOP_ADJUSTMENT
|
||||
#define Z4_ENDSTOP_ADJUSTMENT 0
|
||||
#endif
|
||||
|
||||
@@ -177,9 +177,9 @@ bool Stepper::abort_current_block;
|
||||
|
||||
#if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN)
|
||||
bool Stepper::locked_Z_motor = false, Stepper::locked_Z2_motor = false
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
, Stepper::locked_Z3_motor = false
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
, Stepper::locked_Z4_motor = false
|
||||
#endif
|
||||
#endif
|
||||
@@ -365,7 +365,7 @@ xyze_int8_t Stepper::count_direction{0};
|
||||
A##4_STEP_WRITE(V); \
|
||||
}
|
||||
|
||||
#if ENABLED(X_DUAL_STEPPER_DRIVERS)
|
||||
#if HAS_DUAL_X_STEPPERS
|
||||
#define X_APPLY_DIR(v,Q) do{ X_DIR_WRITE(v); X2_DIR_WRITE((v) ^ ENABLED(INVERT_X2_VS_X_DIR)); }while(0)
|
||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||
#define X_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(X,v)
|
||||
@@ -386,7 +386,7 @@ xyze_int8_t Stepper::count_direction{0};
|
||||
#define X_APPLY_STEP(v,Q) X_STEP_WRITE(v)
|
||||
#endif
|
||||
|
||||
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
|
||||
#if HAS_DUAL_Y_STEPPERS
|
||||
#define Y_APPLY_DIR(v,Q) do{ Y_DIR_WRITE(v); Y2_DIR_WRITE((v) ^ ENABLED(INVERT_Y2_VS_Y_DIR)); }while(0)
|
||||
#if ENABLED(Y_DUAL_ENDSTOPS)
|
||||
#define Y_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(Y,v)
|
||||
@@ -398,7 +398,7 @@ xyze_int8_t Stepper::count_direction{0};
|
||||
#define Y_APPLY_STEP(v,Q) Y_STEP_WRITE(v)
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS == 4
|
||||
#if NUM_Z_STEPPERS == 4
|
||||
#define Z_APPLY_DIR(v,Q) do{ \
|
||||
Z_DIR_WRITE(v); Z2_DIR_WRITE((v) ^ ENABLED(INVERT_Z2_VS_Z_DIR)); \
|
||||
Z3_DIR_WRITE((v) ^ ENABLED(INVERT_Z3_VS_Z_DIR)); Z4_DIR_WRITE((v) ^ ENABLED(INVERT_Z4_VS_Z_DIR)); \
|
||||
@@ -410,7 +410,7 @@ xyze_int8_t Stepper::count_direction{0};
|
||||
#else
|
||||
#define Z_APPLY_STEP(v,Q) do{ Z_STEP_WRITE(v); Z2_STEP_WRITE(v); Z3_STEP_WRITE(v); Z4_STEP_WRITE(v); }while(0)
|
||||
#endif
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 3
|
||||
#elif NUM_Z_STEPPERS == 3
|
||||
#define Z_APPLY_DIR(v,Q) do{ \
|
||||
Z_DIR_WRITE(v); Z2_DIR_WRITE((v) ^ ENABLED(INVERT_Z2_VS_Z_DIR)); Z3_DIR_WRITE((v) ^ ENABLED(INVERT_Z3_VS_Z_DIR)); \
|
||||
}while(0)
|
||||
@@ -421,7 +421,7 @@ xyze_int8_t Stepper::count_direction{0};
|
||||
#else
|
||||
#define Z_APPLY_STEP(v,Q) do{ Z_STEP_WRITE(v); Z2_STEP_WRITE(v); Z3_STEP_WRITE(v); }while(0)
|
||||
#endif
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 2
|
||||
#elif NUM_Z_STEPPERS == 2
|
||||
#define Z_APPLY_DIR(v,Q) do{ Z_DIR_WRITE(v); Z2_DIR_WRITE((v) ^ ENABLED(INVERT_Z2_VS_Z_DIR)); }while(0)
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
#define Z_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(Z,v)
|
||||
@@ -2613,19 +2613,19 @@ void Stepper::init() {
|
||||
TERN_(HAS_X2_DIR, X2_DIR_INIT());
|
||||
#if HAS_Y_DIR
|
||||
Y_DIR_INIT();
|
||||
#if BOTH(Y_DUAL_STEPPER_DRIVERS, HAS_Y2_DIR)
|
||||
#if BOTH(HAS_DUAL_Y_STEPPERS, HAS_Y2_DIR)
|
||||
Y2_DIR_INIT();
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_Z_DIR
|
||||
Z_DIR_INIT();
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 2 && HAS_Z2_DIR
|
||||
#if NUM_Z_STEPPERS >= 2 && HAS_Z2_DIR
|
||||
Z2_DIR_INIT();
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3 && HAS_Z3_DIR
|
||||
#if NUM_Z_STEPPERS >= 3 && HAS_Z3_DIR
|
||||
Z3_DIR_INIT();
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4 && HAS_Z4_DIR
|
||||
#if NUM_Z_STEPPERS >= 4 && HAS_Z4_DIR
|
||||
Z4_DIR_INIT();
|
||||
#endif
|
||||
#endif
|
||||
@@ -2684,7 +2684,7 @@ void Stepper::init() {
|
||||
#if HAS_Y_ENABLE
|
||||
Y_ENABLE_INIT();
|
||||
if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH);
|
||||
#if BOTH(Y_DUAL_STEPPER_DRIVERS, HAS_Y2_ENABLE)
|
||||
#if BOTH(HAS_DUAL_Y_STEPPERS, HAS_Y2_ENABLE)
|
||||
Y2_ENABLE_INIT();
|
||||
if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH);
|
||||
#endif
|
||||
@@ -2692,15 +2692,15 @@ void Stepper::init() {
|
||||
#if HAS_Z_ENABLE
|
||||
Z_ENABLE_INIT();
|
||||
if (!Z_ENABLE_ON) Z_ENABLE_WRITE(HIGH);
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 2 && HAS_Z2_ENABLE
|
||||
#if NUM_Z_STEPPERS >= 2 && HAS_Z2_ENABLE
|
||||
Z2_ENABLE_INIT();
|
||||
if (!Z_ENABLE_ON) Z2_ENABLE_WRITE(HIGH);
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3 && HAS_Z3_ENABLE
|
||||
#if NUM_Z_STEPPERS >= 3 && HAS_Z3_ENABLE
|
||||
Z3_ENABLE_INIT();
|
||||
if (!Z_ENABLE_ON) Z3_ENABLE_WRITE(HIGH);
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4 && HAS_Z4_ENABLE
|
||||
#if NUM_Z_STEPPERS >= 4 && HAS_Z4_ENABLE
|
||||
Z4_ENABLE_INIT();
|
||||
if (!Z_ENABLE_ON) Z4_ENABLE_WRITE(HIGH);
|
||||
#endif
|
||||
@@ -2775,7 +2775,7 @@ void Stepper::init() {
|
||||
|
||||
// Init Step Pins
|
||||
#if HAS_X_STEP
|
||||
#if EITHER(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE)
|
||||
#if HAS_X2_STEPPER
|
||||
X2_STEP_INIT();
|
||||
X2_STEP_WRITE(INVERT_X_STEP_PIN);
|
||||
#endif
|
||||
@@ -2783,7 +2783,7 @@ void Stepper::init() {
|
||||
#endif
|
||||
|
||||
#if HAS_Y_STEP
|
||||
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
|
||||
#if HAS_DUAL_Y_STEPPERS
|
||||
Y2_STEP_INIT();
|
||||
Y2_STEP_WRITE(INVERT_Y_STEP_PIN);
|
||||
#endif
|
||||
@@ -2791,15 +2791,15 @@ void Stepper::init() {
|
||||
#endif
|
||||
|
||||
#if HAS_Z_STEP
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 2
|
||||
#if NUM_Z_STEPPERS >= 2
|
||||
Z2_STEP_INIT();
|
||||
Z2_STEP_WRITE(INVERT_Z_STEP_PIN);
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
Z3_STEP_INIT();
|
||||
Z3_STEP_WRITE(INVERT_Z_STEP_PIN);
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
Z4_STEP_INIT();
|
||||
Z4_STEP_WRITE(INVERT_Z_STEP_PIN);
|
||||
#endif
|
||||
|
||||
@@ -366,9 +366,9 @@ class Stepper {
|
||||
#endif
|
||||
#if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN)
|
||||
static bool locked_Z_motor, locked_Z2_motor
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
, locked_Z3_motor
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
, locked_Z4_motor
|
||||
#endif
|
||||
#endif
|
||||
@@ -570,18 +570,18 @@ class Stepper {
|
||||
#if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN)
|
||||
FORCE_INLINE static void set_z1_lock(const bool state) { locked_Z_motor = state; }
|
||||
FORCE_INLINE static void set_z2_lock(const bool state) { locked_Z2_motor = state; }
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
FORCE_INLINE static void set_z3_lock(const bool state) { locked_Z3_motor = state; }
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
FORCE_INLINE static void set_z4_lock(const bool state) { locked_Z4_motor = state; }
|
||||
#endif
|
||||
#endif
|
||||
static void set_all_z_lock(const bool lock, const int8_t except=-1) {
|
||||
set_z1_lock(lock ^ (except == 0));
|
||||
set_z2_lock(lock ^ (except == 1));
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
set_z3_lock(lock ^ (except == 2));
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
set_z4_lock(lock ^ (except == 3));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -486,10 +486,10 @@
|
||||
#ifndef Z2_USE_ENDSTOP
|
||||
#define Z2_USE_ENDSTOP _ZSTOP_
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3 && !defined(Z3_USE_ENDSTOP)
|
||||
#if NUM_Z_STEPPERS >= 3 && !defined(Z3_USE_ENDSTOP)
|
||||
#define Z3_USE_ENDSTOP _ZSTOP_
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4 && !defined(Z4_USE_ENDSTOP)
|
||||
#if NUM_Z_STEPPERS >= 4 && !defined(Z4_USE_ENDSTOP)
|
||||
#define Z4_USE_ENDSTOP _ZSTOP_
|
||||
#endif
|
||||
#endif
|
||||
@@ -775,14 +775,14 @@
|
||||
#define X2_MS3_PIN -1
|
||||
#endif
|
||||
|
||||
#if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !defined(Y2_DIAG_PIN) && !defined(Y2_STEP_PIN) && !PIN_EXISTS(Y2_CS_PIN)
|
||||
#if HAS_DUAL_Y_STEPPERS && !defined(Y2_DIAG_PIN) && !defined(Y2_STEP_PIN) && !PIN_EXISTS(Y2_CS_PIN)
|
||||
#define Z2_E_INDEX INCREMENT(Y2_E_INDEX)
|
||||
#else
|
||||
#define Z2_E_INDEX Y2_E_INDEX
|
||||
#endif
|
||||
|
||||
// The Y2 axis, if any, should be the next open extruder port
|
||||
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
|
||||
#if HAS_DUAL_Y_STEPPERS
|
||||
#ifndef Y2_STEP_PIN
|
||||
#define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP)
|
||||
#define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR)
|
||||
@@ -861,14 +861,14 @@
|
||||
#define Y2_MS3_PIN -1
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 2 && !defined(Z2_DIAG_PIN) && !defined(Z2_STEP_PIN) && !PIN_EXISTS(Z2_CS_PIN)
|
||||
#if NUM_Z_STEPPERS >= 2 && !defined(Z2_DIAG_PIN) && !defined(Z2_STEP_PIN) && !PIN_EXISTS(Z2_CS_PIN)
|
||||
#define Z3_E_INDEX INCREMENT(Z2_E_INDEX)
|
||||
#else
|
||||
#define Z3_E_INDEX Z2_E_INDEX
|
||||
#endif
|
||||
|
||||
// The Z2 axis, if any, should be the next open extruder port
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 2
|
||||
#if NUM_Z_STEPPERS >= 2
|
||||
#ifndef Z2_STEP_PIN
|
||||
#define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP)
|
||||
#define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR)
|
||||
@@ -947,14 +947,14 @@
|
||||
#define Z2_MS3_PIN -1
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3 && !defined(Z3_DIAG_PIN) && !defined(Z3_STEP_PIN) && !PIN_EXISTS(Z3_CS_PIN)
|
||||
#if NUM_Z_STEPPERS >= 3 && !defined(Z3_DIAG_PIN) && !defined(Z3_STEP_PIN) && !PIN_EXISTS(Z3_CS_PIN)
|
||||
#define Z4_E_INDEX INCREMENT(Z3_E_INDEX)
|
||||
#else
|
||||
#define Z4_E_INDEX Z3_E_INDEX
|
||||
#endif
|
||||
|
||||
// The Z3 axis, if any, should be the next open extruder port
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
#ifndef Z3_STEP_PIN
|
||||
#define Z3_STEP_PIN _EPIN(Z3_E_INDEX, STEP)
|
||||
#define Z3_DIR_PIN _EPIN(Z3_E_INDEX, DIR)
|
||||
@@ -1033,14 +1033,14 @@
|
||||
#define Z3_MS3_PIN -1
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4 && !defined(Z4_DIAG_PIN) && !defined(Z4_STEP_PIN) && !PIN_EXISTS(Z4_CS_PIN)
|
||||
#if NUM_Z_STEPPERS >= 4 && !defined(Z4_DIAG_PIN) && !defined(Z4_STEP_PIN) && !PIN_EXISTS(Z4_CS_PIN)
|
||||
#define I_E_INDEX INCREMENT(Z4_E_INDEX)
|
||||
#else
|
||||
#define I_E_INDEX Z4_E_INDEX
|
||||
#endif
|
||||
|
||||
// The Z4 axis, if any, should be the next open extruder port
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
#ifndef Z4_STEP_PIN
|
||||
#define Z4_STEP_PIN _EPIN(Z4_E_INDEX, STEP)
|
||||
#define Z4_DIR_PIN _EPIN(Z4_E_INDEX, DIR)
|
||||
@@ -1747,16 +1747,16 @@
|
||||
#if DISABLED(Z_MULTI_ENDSTOPS) || Z_HOME_TO_MIN
|
||||
#undef Z2_MAX_PIN
|
||||
#endif
|
||||
#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 3 || Z_HOME_TO_MAX
|
||||
#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPERS < 3 || Z_HOME_TO_MAX
|
||||
#undef Z3_MIN_PIN
|
||||
#endif
|
||||
#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 3 || Z_HOME_TO_MIN
|
||||
#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPERS < 3 || Z_HOME_TO_MIN
|
||||
#undef Z3_MAX_PIN
|
||||
#endif
|
||||
#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 4 || Z_HOME_TO_MAX
|
||||
#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPERS < 4 || Z_HOME_TO_MAX
|
||||
#undef Z4_MIN_PIN
|
||||
#endif
|
||||
#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 4 || Z_HOME_TO_MIN
|
||||
#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPERS < 4 || Z_HOME_TO_MIN
|
||||
#undef Z4_MAX_PIN
|
||||
#endif
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
|
||||
#if HOTENDS > 2 || E_STEPPERS > 2
|
||||
#error "RL200v1 supports up to 2 hotends / E-steppers. Comment out this line to continue."
|
||||
#elif NUM_Z_STEPPER_DRIVERS != 2
|
||||
#error "RL200 uses dual Z stepper motors. Set NUM_Z_STEPPER_DRIVERS to 2 or comment out this line to continue."
|
||||
#elif NUM_Z_STEPPERS != 2
|
||||
#error "RL200 uses dual Z stepper motors. Set NUM_Z_STEPPERS to 2 or comment out this line to continue."
|
||||
#elif !(AXIS_DRIVER_TYPE_X(DRV8825) && AXIS_DRIVER_TYPE_Y(DRV8825) && AXIS_DRIVER_TYPE_Z(DRV8825) && AXIS_DRIVER_TYPE_Z2(DRV8825) && AXIS_DRIVER_TYPE_E0(DRV8825))
|
||||
#error "You must set ([XYZ]|Z2|E0)_DRIVER_TYPE to DRV8825 in Configuration.h for RL200."
|
||||
#endif
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
#define Z_DIR_PIN 48
|
||||
#define Z_ENABLE_PIN 62
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS == 2
|
||||
#if NUM_Z_STEPPERS == 2
|
||||
#define Z2_STEP_PIN 26 // E0 connector
|
||||
#define Z2_DIR_PIN 28
|
||||
#define Z2_ENABLE_PIN 24
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
// This board have the option to use an extra TMC2209 stepper, one of the use could be as a second extruder.
|
||||
#if EXTRUDERS < 2
|
||||
// TODO: Corregir aquí que cuando tenemos dos extrusores o lo que sea, utiliza los endstop que le sobran, osea los max, no hay Z2_endstop
|
||||
#if NUM_Z_STEPPER_DRIVERS > 1
|
||||
#if NUM_Z_STEPPERS > 1
|
||||
#define Z2_STOP_PIN 14
|
||||
#endif
|
||||
#else
|
||||
|
||||
@@ -778,7 +778,7 @@
|
||||
#define _X2_PINS
|
||||
#endif
|
||||
|
||||
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
|
||||
#if HAS_DUAL_Y_STEPPERS
|
||||
#if PIN_EXISTS(Y2_CS) && AXIS_HAS_SPI(Y2)
|
||||
#define _Y2_CS Y2_CS_PIN,
|
||||
#else
|
||||
@@ -804,7 +804,7 @@
|
||||
#define _Y2_PINS
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 2
|
||||
#if NUM_Z_STEPPERS >= 2
|
||||
#if PIN_EXISTS(Z2_CS) && AXIS_HAS_SPI(Z2)
|
||||
#define _Z2_CS Z2_CS_PIN,
|
||||
#else
|
||||
@@ -830,7 +830,7 @@
|
||||
#define _Z2_PINS
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
#if PIN_EXISTS(Z3_CS) && AXIS_HAS_SPI(Z3)
|
||||
#define _Z3_CS Z3_CS_PIN,
|
||||
#else
|
||||
@@ -856,7 +856,7 @@
|
||||
#define _Z3_PINS
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
#if PIN_EXISTS(Z4_CS) && AXIS_HAS_SPI(Z4)
|
||||
#define _Z4_CS Z4_CS_PIN,
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user