✏️ Followup to Six Linear Axes (#22056)
This commit is contained in:
parent
c1fca91103
commit
e3df7d7bc8
|
@ -734,7 +734,7 @@
|
||||||
* the position of the toolhead relative to the workspace.
|
* the position of the toolhead relative to the workspace.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//#define SENSORLESS_BACKOFF_MM { 2, 2 } // (mm) Backoff from endstops before sensorless homing
|
//#define SENSORLESS_BACKOFF_MM { 2, 2, 0 } // (mm) Backoff from endstops before sensorless homing
|
||||||
|
|
||||||
#define HOMING_BUMP_MM { 5, 5, 2 } // (mm) Backoff from endstops after first bump
|
#define HOMING_BUMP_MM { 5, 5, 2 } // (mm) Backoff from endstops after first bump
|
||||||
#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)
|
#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)
|
||||||
|
@ -2253,7 +2253,7 @@
|
||||||
* Extra G-code to run while executing tool-change commands. Can be used to use an additional
|
* Extra G-code to run while executing tool-change commands. Can be used to use an additional
|
||||||
* stepper motor (I axis, see option LINEAR_AXES in Configuration.h) to drive the tool-changer.
|
* stepper motor (I axis, see option LINEAR_AXES in Configuration.h) to drive the tool-changer.
|
||||||
*/
|
*/
|
||||||
//#define EVENT_GCODE_TOOLCHANGE_T0 "G28 A\nG1 I0" // Extra G-code to run while executing tool-change command T0
|
//#define EVENT_GCODE_TOOLCHANGE_T0 "G28 A\nG1 A0" // Extra G-code to run while executing tool-change command T0
|
||||||
//#define EVENT_GCODE_TOOLCHANGE_T1 "G1 A10" // Extra G-code to run while executing tool-change command T1
|
//#define EVENT_GCODE_TOOLCHANGE_T1 "G1 A10" // Extra G-code to run while executing tool-change command T1
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -36,15 +36,15 @@
|
||||||
#define _XMIN_ 100
|
#define _XMIN_ 100
|
||||||
#define _YMIN_ 200
|
#define _YMIN_ 200
|
||||||
#define _ZMIN_ 300
|
#define _ZMIN_ 300
|
||||||
#define _IMIN_ 400
|
#define _IMIN_ 500
|
||||||
#define _JMIN_ 500
|
#define _JMIN_ 600
|
||||||
#define _KMIN_ 600
|
#define _KMIN_ 700
|
||||||
#define _XMAX_ 101
|
#define _XMAX_ 101
|
||||||
#define _YMAX_ 201
|
#define _YMAX_ 201
|
||||||
#define _ZMAX_ 301
|
#define _ZMAX_ 301
|
||||||
#define _IMAX_ 401
|
#define _IMAX_ 501
|
||||||
#define _JMAX_ 501
|
#define _JMAX_ 601
|
||||||
#define _KMAX_ 601
|
#define _KMAX_ 701
|
||||||
#define _XDIAG_ 102
|
#define _XDIAG_ 102
|
||||||
#define _YDIAG_ 202
|
#define _YDIAG_ 202
|
||||||
#define _ZDIAG_ 302
|
#define _ZDIAG_ 302
|
||||||
|
|
|
@ -570,8 +570,8 @@
|
||||||
#error "NEOPIXEL_BKGD_LED_INDEX is now NEOPIXEL_BKGD_INDEX_FIRST."
|
#error "NEOPIXEL_BKGD_LED_INDEX is now NEOPIXEL_BKGD_INDEX_FIRST."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
constexpr float sbm[] = AXIS_RELATIVE_MODES;
|
constexpr float arm[] = AXIS_RELATIVE_MODES;
|
||||||
static_assert(COUNT(sbm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements.");
|
static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements.");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Probe temp compensation requirements
|
* Probe temp compensation requirements
|
||||||
|
|
|
@ -223,7 +223,7 @@ class Endstops {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
union {
|
union {
|
||||||
bool any;
|
bool any;
|
||||||
struct { bool x:1, y:1, z:1; };
|
struct { bool LINEAR_AXIS_LIST(x:1, y:1, z:1, i:1, j:1, k:1); };
|
||||||
};
|
};
|
||||||
} tmc_spi_homing_t;
|
} tmc_spi_homing_t;
|
||||||
static tmc_spi_homing_t tmc_spi_homing;
|
static tmc_spi_homing_t tmc_spi_homing;
|
||||||
|
|
|
@ -588,27 +588,27 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s/*=0.0*/) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LINEAR_AXES == 4
|
#if LINEAR_AXES >= 4
|
||||||
void do_blocking_move_to_i(const_float_t ri, const_feedRate_t fr_mm_s/*=0.0*/) {
|
void do_blocking_move_to_i(const_float_t ri, const_feedRate_t fr_mm_s/*=0.0*/) {
|
||||||
do_blocking_move_to_xyz_i(current_position, ri, fr_mm_s);
|
do_blocking_move_to_xyz_i(current_position, ri, fr_mm_s);
|
||||||
}
|
}
|
||||||
void do_blocking_move_to_xyz_i(const xyze_pos_t &raw, const_float_t i, const_feedRate_t fr_mm_s/*=0.0f*/) {
|
void do_blocking_move_to_xyz_i(const xyze_pos_t &raw, const_float_t i, const_feedRate_t fr_mm_s/*=0.0f*/) {
|
||||||
do_blocking_move_to(raw.x, raw.y, raw.z, i, fr_mm_s);
|
do_blocking_move_to(
|
||||||
|
LINEAR_AXIS_LIST(raw.x, raw.y, raw.z, i, raw.j, raw.k),
|
||||||
|
fr_mm_s
|
||||||
|
);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LINEAR_AXES >= 5
|
#if LINEAR_AXES >= 5
|
||||||
void do_blocking_move_to_i(const_float_t ri, const_feedRate_t fr_mm_s/*=0.0*/) {
|
|
||||||
do_blocking_move_to_xyz_i(current_position, ri, fr_mm_s);
|
|
||||||
}
|
|
||||||
void do_blocking_move_to_xyz_i(const xyze_pos_t &raw, const_float_t i, const_feedRate_t fr_mm_s/*=0.0f*/) {
|
|
||||||
do_blocking_move_to(raw.x, raw.y, raw.z, i, raw.j, fr_mm_s);
|
|
||||||
}
|
|
||||||
void do_blocking_move_to_j(const_float_t rj, const_feedRate_t fr_mm_s/*=0.0*/) {
|
void do_blocking_move_to_j(const_float_t rj, const_feedRate_t fr_mm_s/*=0.0*/) {
|
||||||
do_blocking_move_to_xyzi_j(current_position, rj, fr_mm_s);
|
do_blocking_move_to_xyzi_j(current_position, rj, fr_mm_s);
|
||||||
}
|
}
|
||||||
void do_blocking_move_to_xyzi_j(const xyze_pos_t &raw, const_float_t j, const_feedRate_t fr_mm_s/*=0.0f*/) {
|
void do_blocking_move_to_xyzi_j(const xyze_pos_t &raw, const_float_t j, const_feedRate_t fr_mm_s/*=0.0f*/) {
|
||||||
do_blocking_move_to(raw.x, raw.y, raw.z, raw.i, j, fr_mm_s);
|
do_blocking_move_to(
|
||||||
|
LINEAR_AXIS_LIST(raw.x, raw.y, raw.z, raw.i, j, raw.k),
|
||||||
|
fr_mm_s
|
||||||
|
);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -617,7 +617,10 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s/*=0.0*/) {
|
||||||
do_blocking_move_to_xyzij_k(current_position, rk, fr_mm_s);
|
do_blocking_move_to_xyzij_k(current_position, rk, fr_mm_s);
|
||||||
}
|
}
|
||||||
void do_blocking_move_to_xyzij_k(const xyze_pos_t &raw, const_float_t k, const_feedRate_t fr_mm_s/*=0.0f*/) {
|
void do_blocking_move_to_xyzij_k(const xyze_pos_t &raw, const_float_t k, const_feedRate_t fr_mm_s/*=0.0f*/) {
|
||||||
do_blocking_move_to(raw.x, raw.y, raw.z, raw.i, raw.j, k, fr_mm_s);
|
do_blocking_move_to(
|
||||||
|
LINEAR_AXIS_LIST(raw.x, raw.y, raw.z, raw.i, raw.j, k),
|
||||||
|
fr_mm_s
|
||||||
|
);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -822,7 +825,7 @@ void restore_feedrate_and_scaling() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if LINEAR_AXES >= 4 // TODO (DerAndere): Find out why this was missing / removed
|
#if LINEAR_AXES >= 4
|
||||||
if (axis_was_homed(I_AXIS)) {
|
if (axis_was_homed(I_AXIS)) {
|
||||||
#if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_I)
|
#if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_I)
|
||||||
NOLESS(target.i, soft_endstop.min.i);
|
NOLESS(target.i, soft_endstop.min.i);
|
||||||
|
@ -1295,7 +1298,7 @@ void prepare_line_to_destination() {
|
||||||
|
|
||||||
bool homing_needed_error(linear_axis_bits_t axis_bits/*=linear_bits*/) {
|
bool homing_needed_error(linear_axis_bits_t axis_bits/*=linear_bits*/) {
|
||||||
if ((axis_bits = axes_should_home(axis_bits))) {
|
if ((axis_bits = axes_should_home(axis_bits))) {
|
||||||
PGM_P home_first = GET_TEXT(MSG_HOME_FIRST); // TODO: (DerAndere) Set this up for extra axes
|
PGM_P home_first = GET_TEXT(MSG_HOME_FIRST);
|
||||||
char msg[strlen_P(home_first)+1];
|
char msg[strlen_P(home_first)+1];
|
||||||
sprintf_P(msg, home_first,
|
sprintf_P(msg, home_first,
|
||||||
LINEAR_AXIS_LIST(
|
LINEAR_AXIS_LIST(
|
||||||
|
@ -1390,8 +1393,21 @@ void prepare_line_to_destination() {
|
||||||
#if ENABLED(SPI_ENDSTOPS)
|
#if ENABLED(SPI_ENDSTOPS)
|
||||||
switch (axis) {
|
switch (axis) {
|
||||||
case X_AXIS: if (ENABLED(X_SPI_SENSORLESS)) endstops.tmc_spi_homing.x = true; break;
|
case X_AXIS: if (ENABLED(X_SPI_SENSORLESS)) endstops.tmc_spi_homing.x = true; break;
|
||||||
|
#if HAS_Y_AXIS
|
||||||
case Y_AXIS: if (ENABLED(Y_SPI_SENSORLESS)) endstops.tmc_spi_homing.y = true; break;
|
case Y_AXIS: if (ENABLED(Y_SPI_SENSORLESS)) endstops.tmc_spi_homing.y = true; break;
|
||||||
|
#endif
|
||||||
|
#if HAS_Z_AXIS
|
||||||
case Z_AXIS: if (ENABLED(Z_SPI_SENSORLESS)) endstops.tmc_spi_homing.z = true; break;
|
case Z_AXIS: if (ENABLED(Z_SPI_SENSORLESS)) endstops.tmc_spi_homing.z = true; break;
|
||||||
|
#endif
|
||||||
|
#if LINEAR_AXES >= 4
|
||||||
|
case I_AXIS: if (ENABLED(I_SPI_SENSORLESS)) endstops.tmc_spi_homing.i = true; break;
|
||||||
|
#endif
|
||||||
|
#if LINEAR_AXES >= 5
|
||||||
|
case J_AXIS: if (ENABLED(J_SPI_SENSORLESS)) endstops.tmc_spi_homing.j = true; break;
|
||||||
|
#endif
|
||||||
|
#if LINEAR_AXES >= 6
|
||||||
|
case K_AXIS: if (ENABLED(K_SPI_SENSORLESS)) endstops.tmc_spi_homing.k = true; break;
|
||||||
|
#endif
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1454,11 +1470,21 @@ void prepare_line_to_destination() {
|
||||||
#if ENABLED(SPI_ENDSTOPS)
|
#if ENABLED(SPI_ENDSTOPS)
|
||||||
switch (axis) {
|
switch (axis) {
|
||||||
case X_AXIS: if (ENABLED(X_SPI_SENSORLESS)) endstops.tmc_spi_homing.x = false; break;
|
case X_AXIS: if (ENABLED(X_SPI_SENSORLESS)) endstops.tmc_spi_homing.x = false; break;
|
||||||
|
#if HAS_Y_AXIS
|
||||||
case Y_AXIS: if (ENABLED(Y_SPI_SENSORLESS)) endstops.tmc_spi_homing.y = false; break;
|
case Y_AXIS: if (ENABLED(Y_SPI_SENSORLESS)) endstops.tmc_spi_homing.y = false; break;
|
||||||
|
#endif
|
||||||
|
#if HAS_Z_AXIS
|
||||||
case Z_AXIS: if (ENABLED(Z_SPI_SENSORLESS)) endstops.tmc_spi_homing.z = false; break;
|
case Z_AXIS: if (ENABLED(Z_SPI_SENSORLESS)) endstops.tmc_spi_homing.z = false; break;
|
||||||
|
#endif
|
||||||
|
#if LINEAR_AXES >= 4
|
||||||
case I_AXIS: if (ENABLED(I_SPI_SENSORLESS)) endstops.tmc_spi_homing.i = false; break;
|
case I_AXIS: if (ENABLED(I_SPI_SENSORLESS)) endstops.tmc_spi_homing.i = false; break;
|
||||||
|
#endif
|
||||||
|
#if LINEAR_AXES >= 5
|
||||||
case J_AXIS: if (ENABLED(J_SPI_SENSORLESS)) endstops.tmc_spi_homing.j = false; break;
|
case J_AXIS: if (ENABLED(J_SPI_SENSORLESS)) endstops.tmc_spi_homing.j = false; break;
|
||||||
|
#endif
|
||||||
|
#if LINEAR_AXES >= 6
|
||||||
case K_AXIS: if (ENABLED(K_SPI_SENSORLESS)) endstops.tmc_spi_homing.k = false; break;
|
case K_AXIS: if (ENABLED(K_SPI_SENSORLESS)) endstops.tmc_spi_homing.k = false; break;
|
||||||
|
#endif
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1734,11 +1760,11 @@ void prepare_line_to_destination() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Back away to prevent an early X/Y sensorless trigger
|
// Back away to prevent an early sensorless trigger
|
||||||
//
|
//
|
||||||
#if DISABLED(DELTA) && defined(SENSORLESS_BACKOFF_MM)
|
#if DISABLED(DELTA) && defined(SENSORLESS_BACKOFF_MM)
|
||||||
const xy_float_t backoff = SENSORLESS_BACKOFF_MM;
|
const xyz_float_t backoff = SENSORLESS_BACKOFF_MM;
|
||||||
if ((TERN0(X_SENSORLESS, axis == X_AXIS) || TERN0(Y_SENSORLESS, axis == Y_AXIS)) && backoff[axis]) {
|
if ((TERN0(X_SENSORLESS, axis == X_AXIS) || TERN0(Y_SENSORLESS, axis == Y_AXIS) || TERN0(Z_SENSORLESS, axis == Z_AXIS) || TERN0(I_SENSORLESS, axis == I_AXIS) || TERN0(J_SENSORLESS, axis == J_AXIS) || TERN0(K_SENSORLESS, axis == K_AXIS)) && backoff[axis]) {
|
||||||
const float backoff_length = -ABS(backoff[axis]) * axis_home_dir;
|
const float backoff_length = -ABS(backoff[axis]) * axis_home_dir;
|
||||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Sensorless backoff: ", backoff_length, "mm");
|
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Sensorless backoff: ", backoff_length, "mm");
|
||||||
do_homing_move(axis, backoff_length, homing_feedrate(axis));
|
do_homing_move(axis, backoff_length, homing_feedrate(axis));
|
||||||
|
@ -1777,6 +1803,15 @@ void prepare_line_to_destination() {
|
||||||
case X_AXIS: es = X_ENDSTOP; break;
|
case X_AXIS: es = X_ENDSTOP; break;
|
||||||
case Y_AXIS: es = Y_ENDSTOP; break;
|
case Y_AXIS: es = Y_ENDSTOP; break;
|
||||||
case Z_AXIS: es = Z_ENDSTOP; break;
|
case Z_AXIS: es = Z_ENDSTOP; break;
|
||||||
|
#if LINEAR_AXES >= 4
|
||||||
|
case I_AXIS: es = I_ENDSTOP; break;
|
||||||
|
#endif
|
||||||
|
#if LINEAR_AXES >= 5
|
||||||
|
case J_AXIS: es = J_ENDSTOP; break;
|
||||||
|
#endif
|
||||||
|
#if LINEAR_AXES >= 6
|
||||||
|
case K_AXIS: es = K_ENDSTOP; break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (TEST(endstops.state(), es)) {
|
if (TEST(endstops.state(), es)) {
|
||||||
SERIAL_ECHO_MSG("Bad ", AS_CHAR(AXIS_CHAR(axis)), " Endstop?");
|
SERIAL_ECHO_MSG("Bad ", AS_CHAR(AXIS_CHAR(axis)), " Endstop?");
|
||||||
|
|
|
@ -180,7 +180,7 @@ inline float home_bump_mm(const AxisEnum axis) {
|
||||||
TERN_(MAX_SOFTWARE_ENDSTOP_Z, amax = max.z);
|
TERN_(MAX_SOFTWARE_ENDSTOP_Z, amax = max.z);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if LINEAR_AXES >= 4 // TODO (DerAndere): Test for LINEAR_AXES >= 4
|
#if LINEAR_AXES >= 4
|
||||||
case I_AXIS:
|
case I_AXIS:
|
||||||
TERN_(MIN_SOFTWARE_ENDSTOP_I, amin = min.i);
|
TERN_(MIN_SOFTWARE_ENDSTOP_I, amin = min.i);
|
||||||
TERN_(MIN_SOFTWARE_ENDSTOP_I, amax = max.i);
|
TERN_(MIN_SOFTWARE_ENDSTOP_I, amax = max.i);
|
||||||
|
|
|
@ -1451,7 +1451,7 @@ void Planner::check_axes_activity() {
|
||||||
float high = 0.0;
|
float high = 0.0;
|
||||||
for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) {
|
for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) {
|
||||||
block_t *block = &block_buffer[b];
|
block_t *block = &block_buffer[b];
|
||||||
if (LINEAR_AXIS_GANG(block->steps.x, || block->steps.y, || block->steps.z, block->steps.i, || block->steps.j, || block->steps.k)) {
|
if (LINEAR_AXIS_GANG(block->steps.x, || block->steps.y, || block->steps.z, || block->steps.i, || block->steps.j, || block->steps.k)) {
|
||||||
const float se = (float)block->steps.e / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec;
|
const float se = (float)block->steps.e / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec;
|
||||||
NOLESS(high, se);
|
NOLESS(high, se);
|
||||||
}
|
}
|
||||||
|
@ -2852,7 +2852,7 @@ bool Planner::buffer_segment(const abce_pos_t &abce
|
||||||
int32_t(LROUND(abce.a * settings.axis_steps_per_mm[A_AXIS])),
|
int32_t(LROUND(abce.a * settings.axis_steps_per_mm[A_AXIS])),
|
||||||
int32_t(LROUND(abce.b * settings.axis_steps_per_mm[B_AXIS])),
|
int32_t(LROUND(abce.b * settings.axis_steps_per_mm[B_AXIS])),
|
||||||
int32_t(LROUND(abce.c * settings.axis_steps_per_mm[C_AXIS])),
|
int32_t(LROUND(abce.c * settings.axis_steps_per_mm[C_AXIS])),
|
||||||
int32_t(LROUND(abce.i * settings.axis_steps_per_mm[I_AXIS])), // FIXME (DerAndere): Multiplication by 4.0 is a work-around for issue with wrong internal steps per mm
|
int32_t(LROUND(abce.i * settings.axis_steps_per_mm[I_AXIS])),
|
||||||
int32_t(LROUND(abce.j * settings.axis_steps_per_mm[J_AXIS])),
|
int32_t(LROUND(abce.j * settings.axis_steps_per_mm[J_AXIS])),
|
||||||
int32_t(LROUND(abce.k * settings.axis_steps_per_mm[K_AXIS]))
|
int32_t(LROUND(abce.k * settings.axis_steps_per_mm[K_AXIS]))
|
||||||
)
|
)
|
||||||
|
@ -2893,7 +2893,7 @@ bool Planner::buffer_segment(const abce_pos_t &abce
|
||||||
#endif
|
#endif
|
||||||
#if LINEAR_AXES >= 4
|
#if LINEAR_AXES >= 4
|
||||||
SERIAL_ECHOPAIR_P(SP_I_LBL, abce.i);
|
SERIAL_ECHOPAIR_P(SP_I_LBL, abce.i);
|
||||||
SERIAL_ECHOPAIR(" (", position.i, "->", target.i); // FIXME (DerAndere): Introduce work-around for issue with wrong internal steps per mm and feedrate for I_AXIS
|
SERIAL_ECHOPAIR(" (", position.i, "->", target.i);
|
||||||
SERIAL_CHAR(')');
|
SERIAL_CHAR(')');
|
||||||
#endif
|
#endif
|
||||||
#if LINEAR_AXES >= 5
|
#if LINEAR_AXES >= 5
|
||||||
|
|
|
@ -766,11 +766,7 @@ enum StealthIndex : uint8_t {
|
||||||
pwmconf.pwm_ofs = 36;
|
pwmconf.pwm_ofs = 36;
|
||||||
st.PWMCONF(pwmconf.sr);
|
st.PWMCONF(pwmconf.sr);
|
||||||
|
|
||||||
#if ENABLED(HYBRID_THRESHOLD)
|
TERN(HYBRID_THRESHOLD, st.set_pwm_thrs(hyb_thrs), UNUSED(hyb_thrs));
|
||||||
st.set_pwm_thrs(hyb_thrs);
|
|
||||||
#else
|
|
||||||
UNUSED(hyb_thrs);
|
|
||||||
#endif
|
|
||||||
st.GSTAT(); // Clear GSTAT
|
st.GSTAT(); // Clear GSTAT
|
||||||
}
|
}
|
||||||
#endif // TMC5160
|
#endif // TMC5160
|
||||||
|
@ -971,11 +967,12 @@ void reset_trinamic_drivers() {
|
||||||
// Using a fixed-length character array for the port name allows this to be constexpr compatible.
|
// Using a fixed-length character array for the port name allows this to be constexpr compatible.
|
||||||
struct SanityHwSerialDetails { const char port[20]; uint32_t address; };
|
struct SanityHwSerialDetails { const char port[20]; uint32_t address; };
|
||||||
#define TMC_HW_DETAIL_ARGS(A) TERN(A##_HAS_HW_SERIAL, STRINGIFY(A##_HARDWARE_SERIAL), ""), TERN0(A##_HAS_HW_SERIAL, A##_SLAVE_ADDRESS)
|
#define TMC_HW_DETAIL_ARGS(A) TERN(A##_HAS_HW_SERIAL, STRINGIFY(A##_HARDWARE_SERIAL), ""), TERN0(A##_HAS_HW_SERIAL, A##_SLAVE_ADDRESS)
|
||||||
#define TMC_HW_DETAIL(A) {TMC_HW_DETAIL_ARGS(A)}
|
#define TMC_HW_DETAIL(A) { TMC_HW_DETAIL_ARGS(A) }
|
||||||
constexpr SanityHwSerialDetails sanity_tmc_hw_details[] = {
|
constexpr SanityHwSerialDetails sanity_tmc_hw_details[] = {
|
||||||
TMC_HW_DETAIL(X), TMC_HW_DETAIL(X2),
|
TMC_HW_DETAIL(X), TMC_HW_DETAIL(X2),
|
||||||
TMC_HW_DETAIL(Y), TMC_HW_DETAIL(Y2),
|
TMC_HW_DETAIL(Y), TMC_HW_DETAIL(Y2),
|
||||||
TMC_HW_DETAIL(Z), TMC_HW_DETAIL(Z2), TMC_HW_DETAIL(Z3), TMC_HW_DETAIL(Z4),
|
TMC_HW_DETAIL(Z), TMC_HW_DETAIL(Z2), TMC_HW_DETAIL(Z3), TMC_HW_DETAIL(Z4),
|
||||||
|
TMC_HW_DETAIL(I), TMC_HW_DETAIL(J), TMC_HW_DETAIL(K),
|
||||||
TMC_HW_DETAIL(E0), TMC_HW_DETAIL(E1), TMC_HW_DETAIL(E2), TMC_HW_DETAIL(E3), TMC_HW_DETAIL(E4), TMC_HW_DETAIL(E5), TMC_HW_DETAIL(E6), TMC_HW_DETAIL(E7)
|
TMC_HW_DETAIL(E0), TMC_HW_DETAIL(E1), TMC_HW_DETAIL(E2), TMC_HW_DETAIL(E3), TMC_HW_DETAIL(E4), TMC_HW_DETAIL(E5), TMC_HW_DETAIL(E6), TMC_HW_DETAIL(E7)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -995,10 +992,11 @@ void reset_trinamic_drivers() {
|
||||||
|
|
||||||
#define TMC_HWSERIAL_CONFLICT_MSG(A) STRINGIFY(A) "_SLAVE_ADDRESS conflicts with another driver using the same " STRINGIFY(A) "_HARDWARE_SERIAL"
|
#define TMC_HWSERIAL_CONFLICT_MSG(A) STRINGIFY(A) "_SLAVE_ADDRESS conflicts with another driver using the same " STRINGIFY(A) "_HARDWARE_SERIAL"
|
||||||
#define SA_NO_TMC_HW_C(A) static_assert(1 >= count_tmc_hw_serial_matches(TMC_HW_DETAIL_ARGS(A), 0, COUNT(sanity_tmc_hw_details)), TMC_HWSERIAL_CONFLICT_MSG(A));
|
#define SA_NO_TMC_HW_C(A) static_assert(1 >= count_tmc_hw_serial_matches(TMC_HW_DETAIL_ARGS(A), 0, COUNT(sanity_tmc_hw_details)), TMC_HWSERIAL_CONFLICT_MSG(A));
|
||||||
SA_NO_TMC_HW_C(X);SA_NO_TMC_HW_C(X2);
|
SA_NO_TMC_HW_C(X); SA_NO_TMC_HW_C(X2);
|
||||||
SA_NO_TMC_HW_C(Y);SA_NO_TMC_HW_C(Y2);
|
SA_NO_TMC_HW_C(Y); SA_NO_TMC_HW_C(Y2);
|
||||||
SA_NO_TMC_HW_C(Z);SA_NO_TMC_HW_C(Z2);SA_NO_TMC_HW_C(Z3);SA_NO_TMC_HW_C(Z4);
|
SA_NO_TMC_HW_C(Z); SA_NO_TMC_HW_C(Z2); SA_NO_TMC_HW_C(Z3); SA_NO_TMC_HW_C(Z4);
|
||||||
SA_NO_TMC_HW_C(E0);SA_NO_TMC_HW_C(E1);SA_NO_TMC_HW_C(E2);SA_NO_TMC_HW_C(E3);SA_NO_TMC_HW_C(E4);SA_NO_TMC_HW_C(E5);SA_NO_TMC_HW_C(E6);SA_NO_TMC_HW_C(E7);
|
SA_NO_TMC_HW_C(I); SA_NO_TMC_HW_C(J); SA_NO_TMC_HW_C(K);
|
||||||
|
SA_NO_TMC_HW_C(E0); SA_NO_TMC_HW_C(E1); SA_NO_TMC_HW_C(E2); SA_NO_TMC_HW_C(E3); SA_NO_TMC_HW_C(E4); SA_NO_TMC_HW_C(E5); SA_NO_TMC_HW_C(E6); SA_NO_TMC_HW_C(E7);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ANY_AXIS_HAS(SW_SERIAL)
|
#if ANY_AXIS_HAS(SW_SERIAL)
|
||||||
|
@ -1009,6 +1007,7 @@ void reset_trinamic_drivers() {
|
||||||
TMC_SW_DETAIL(X), TMC_SW_DETAIL(X2),
|
TMC_SW_DETAIL(X), TMC_SW_DETAIL(X2),
|
||||||
TMC_SW_DETAIL(Y), TMC_SW_DETAIL(Y2),
|
TMC_SW_DETAIL(Y), TMC_SW_DETAIL(Y2),
|
||||||
TMC_SW_DETAIL(Z), TMC_SW_DETAIL(Z2), TMC_SW_DETAIL(Z3), TMC_SW_DETAIL(Z4),
|
TMC_SW_DETAIL(Z), TMC_SW_DETAIL(Z2), TMC_SW_DETAIL(Z3), TMC_SW_DETAIL(Z4),
|
||||||
|
TMC_SW_DETAIL(I), TMC_SW_DETAIL(J), TMC_SW_DETAIL(K),
|
||||||
TMC_SW_DETAIL(E0), TMC_SW_DETAIL(E1), TMC_SW_DETAIL(E2), TMC_SW_DETAIL(E3), TMC_SW_DETAIL(E4), TMC_SW_DETAIL(E5), TMC_SW_DETAIL(E6), TMC_SW_DETAIL(E7)
|
TMC_SW_DETAIL(E0), TMC_SW_DETAIL(E1), TMC_SW_DETAIL(E2), TMC_SW_DETAIL(E3), TMC_SW_DETAIL(E4), TMC_SW_DETAIL(E5), TMC_SW_DETAIL(E6), TMC_SW_DETAIL(E7)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1023,10 +1022,11 @@ void reset_trinamic_drivers() {
|
||||||
|
|
||||||
#define TMC_SWSERIAL_CONFLICT_MSG(A) STRINGIFY(A) "_SLAVE_ADDRESS conflicts with another driver using the same " STRINGIFY(A) "_SERIAL_RX_PIN or " STRINGIFY(A) "_SERIAL_TX_PIN"
|
#define TMC_SWSERIAL_CONFLICT_MSG(A) STRINGIFY(A) "_SLAVE_ADDRESS conflicts with another driver using the same " STRINGIFY(A) "_SERIAL_RX_PIN or " STRINGIFY(A) "_SERIAL_TX_PIN"
|
||||||
#define SA_NO_TMC_SW_C(A) static_assert(1 >= count_tmc_sw_serial_matches(TMC_SW_DETAIL_ARGS(A), 0, COUNT(sanity_tmc_sw_details)), TMC_SWSERIAL_CONFLICT_MSG(A));
|
#define SA_NO_TMC_SW_C(A) static_assert(1 >= count_tmc_sw_serial_matches(TMC_SW_DETAIL_ARGS(A), 0, COUNT(sanity_tmc_sw_details)), TMC_SWSERIAL_CONFLICT_MSG(A));
|
||||||
SA_NO_TMC_SW_C(X);SA_NO_TMC_SW_C(X2);
|
SA_NO_TMC_SW_C(X); SA_NO_TMC_SW_C(X2);
|
||||||
SA_NO_TMC_SW_C(Y);SA_NO_TMC_SW_C(Y2);
|
SA_NO_TMC_SW_C(Y); SA_NO_TMC_SW_C(Y2);
|
||||||
SA_NO_TMC_SW_C(Z);SA_NO_TMC_SW_C(Z2);SA_NO_TMC_SW_C(Z3);SA_NO_TMC_SW_C(Z4);
|
SA_NO_TMC_SW_C(Z); SA_NO_TMC_SW_C(Z2); SA_NO_TMC_SW_C(Z3); SA_NO_TMC_SW_C(Z4);
|
||||||
SA_NO_TMC_SW_C(E0);SA_NO_TMC_SW_C(E1);SA_NO_TMC_SW_C(E2);SA_NO_TMC_SW_C(E3);SA_NO_TMC_SW_C(E4);SA_NO_TMC_SW_C(E5);SA_NO_TMC_SW_C(E6);SA_NO_TMC_SW_C(E7);
|
SA_NO_TMC_SW_C(I); SA_NO_TMC_SW_C(J); SA_NO_TMC_SW_C(K);
|
||||||
|
SA_NO_TMC_SW_C(E0); SA_NO_TMC_SW_C(E1); SA_NO_TMC_SW_C(E2); SA_NO_TMC_SW_C(E3); SA_NO_TMC_SW_C(E4); SA_NO_TMC_SW_C(E5); SA_NO_TMC_SW_C(E6); SA_NO_TMC_SW_C(E7);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // HAS_TRINAMIC_CONFIG
|
#endif // HAS_TRINAMIC_CONFIG
|
||||||
|
|
|
@ -212,6 +212,15 @@
|
||||||
#if !AXIS_HAS_SPI(Z)
|
#if !AXIS_HAS_SPI(Z)
|
||||||
#undef Z_CS_PIN
|
#undef Z_CS_PIN
|
||||||
#endif
|
#endif
|
||||||
|
#if !AXIS_HAS_SPI(I)
|
||||||
|
#undef I_CS_PIN
|
||||||
|
#endif
|
||||||
|
#if !AXIS_HAS_SPI(J)
|
||||||
|
#undef J_CS_PIN
|
||||||
|
#endif
|
||||||
|
#if !AXIS_HAS_SPI(K)
|
||||||
|
#undef K_CS_PIN
|
||||||
|
#endif
|
||||||
#if E_STEPPERS && !AXIS_HAS_SPI(E0)
|
#if E_STEPPERS && !AXIS_HAS_SPI(E0)
|
||||||
#undef E0_CS_PIN
|
#undef E0_CS_PIN
|
||||||
#endif
|
#endif
|
||||||
|
@ -246,6 +255,15 @@
|
||||||
#ifndef Z_CS_PIN
|
#ifndef Z_CS_PIN
|
||||||
#define Z_CS_PIN -1
|
#define Z_CS_PIN -1
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef I_CS_PIN
|
||||||
|
#define I_CS_PIN -1
|
||||||
|
#endif
|
||||||
|
#ifndef J_CS_PIN
|
||||||
|
#define J_CS_PIN -1
|
||||||
|
#endif
|
||||||
|
#ifndef K_CS_PIN
|
||||||
|
#define K_CS_PIN -1
|
||||||
|
#endif
|
||||||
#ifndef E0_CS_PIN
|
#ifndef E0_CS_PIN
|
||||||
#define E0_CS_PIN -1
|
#define E0_CS_PIN -1
|
||||||
#endif
|
#endif
|
||||||
|
@ -900,43 +918,55 @@
|
||||||
#undef Z_MIN_PROBE_PIN
|
#undef Z_MIN_PROBE_PIN
|
||||||
#define Z_MIN_PROBE_PIN -1
|
#define Z_MIN_PROBE_PIN -1
|
||||||
#endif
|
#endif
|
||||||
|
#if DISABLED(USE_XMIN_PLUG)
|
||||||
|
#undef X_MIN_PIN
|
||||||
|
#define X_MIN_PIN -1
|
||||||
|
#endif
|
||||||
#if DISABLED(USE_XMAX_PLUG)
|
#if DISABLED(USE_XMAX_PLUG)
|
||||||
#undef X_MAX_PIN
|
#undef X_MAX_PIN
|
||||||
#define X_MAX_PIN -1
|
#define X_MAX_PIN -1
|
||||||
#endif
|
#endif
|
||||||
|
#if DISABLED(USE_YMIN_PLUG)
|
||||||
|
#undef Y_MIN_PIN
|
||||||
|
#define Y_MIN_PIN -1
|
||||||
|
#endif
|
||||||
#if DISABLED(USE_YMAX_PLUG)
|
#if DISABLED(USE_YMAX_PLUG)
|
||||||
#undef Y_MAX_PIN
|
#undef Y_MAX_PIN
|
||||||
#define Y_MAX_PIN -1
|
#define Y_MAX_PIN -1
|
||||||
#endif
|
#endif
|
||||||
|
#if DISABLED(USE_ZMIN_PLUG)
|
||||||
|
#undef Z_MIN_PIN
|
||||||
|
#define Z_MIN_PIN -1
|
||||||
|
#endif
|
||||||
#if DISABLED(USE_ZMAX_PLUG)
|
#if DISABLED(USE_ZMAX_PLUG)
|
||||||
#undef Z_MAX_PIN
|
#undef Z_MAX_PIN
|
||||||
#define Z_MAX_PIN -1
|
#define Z_MAX_PIN -1
|
||||||
#endif
|
#endif
|
||||||
|
#if DISABLED(USE_IMIN_PLUG)
|
||||||
|
#undef I_MIN_PIN
|
||||||
|
#define I_MIN_PIN -1
|
||||||
|
#endif
|
||||||
#if DISABLED(USE_IMAX_PLUG)
|
#if DISABLED(USE_IMAX_PLUG)
|
||||||
#undef I_MAX_PIN
|
#undef I_MAX_PIN
|
||||||
#define I_MAX_PIN -1
|
#define I_MAX_PIN -1
|
||||||
#endif
|
#endif
|
||||||
|
#if DISABLED(USE_JMIN_PLUG)
|
||||||
|
#undef J_MIN_PIN
|
||||||
|
#define J_MIN_PIN -1
|
||||||
|
#endif
|
||||||
#if DISABLED(USE_JMAX_PLUG)
|
#if DISABLED(USE_JMAX_PLUG)
|
||||||
#undef J_MAX_PIN
|
#undef J_MAX_PIN
|
||||||
#define J_MAX_PIN -1
|
#define J_MAX_PIN -1
|
||||||
#endif
|
#endif
|
||||||
|
#if DISABLED(USE_KMIN_PLUG)
|
||||||
|
#undef K_MIN_PIN
|
||||||
|
#define K_MIN_PIN -1
|
||||||
|
#endif
|
||||||
#if DISABLED(USE_KMAX_PLUG)
|
#if DISABLED(USE_KMAX_PLUG)
|
||||||
#undef K_MAX_PIN
|
#undef K_MAX_PIN
|
||||||
#define K_MAX_PIN -1
|
#define K_MAX_PIN -1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if DISABLED(USE_XMIN_PLUG)
|
|
||||||
#undef X_MIN_PIN
|
|
||||||
#define X_MIN_PIN -1
|
|
||||||
#endif
|
|
||||||
#if DISABLED(USE_YMIN_PLUG)
|
|
||||||
#undef Y_MIN_PIN
|
|
||||||
#define Y_MIN_PIN -1
|
|
||||||
#endif
|
|
||||||
#if DISABLED(USE_ZMIN_PLUG)
|
|
||||||
#undef Z_MIN_PIN
|
|
||||||
#define Z_MIN_PIN -1
|
|
||||||
#endif
|
|
||||||
#if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_TO_MAX
|
#if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_TO_MAX
|
||||||
#undef X2_MIN_PIN
|
#undef X2_MIN_PIN
|
||||||
#endif
|
#endif
|
||||||
|
@ -968,19 +998,6 @@
|
||||||
#undef Z4_MAX_PIN
|
#undef Z4_MAX_PIN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if DISABLED(USE_IMIN_PLUG)
|
|
||||||
#undef I_MIN_PIN
|
|
||||||
#define I_MIN_PIN -1
|
|
||||||
#endif
|
|
||||||
#if DISABLED(USE_JMIN_PLUG)
|
|
||||||
#undef J_MIN_PIN
|
|
||||||
#define J_MIN_PIN -1
|
|
||||||
#endif
|
|
||||||
#if DISABLED(USE_KMIN_PLUG)
|
|
||||||
#undef K_MIN_PIN
|
|
||||||
#define K_MIN_PIN -1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Default DOGLCD SPI delays
|
// Default DOGLCD SPI delays
|
||||||
//
|
//
|
||||||
|
|
|
@ -167,7 +167,7 @@
|
||||||
#else
|
#else
|
||||||
#define _I_MAX
|
#define _I_MAX
|
||||||
#endif
|
#endif
|
||||||
#if PIN_EXISTS(I_CS)
|
#if PIN_EXISTS(I_CS) && AXIS_HAS_SPI(I)
|
||||||
#define _I_CS I_CS_PIN,
|
#define _I_CS I_CS_PIN,
|
||||||
#else
|
#else
|
||||||
#define _I_CS
|
#define _I_CS
|
||||||
|
@ -208,7 +208,7 @@
|
||||||
#else
|
#else
|
||||||
#define _J_MAX
|
#define _J_MAX
|
||||||
#endif
|
#endif
|
||||||
#if PIN_EXISTS(J_CS)
|
#if PIN_EXISTS(J_CS) && AXIS_HAS_SPI(J)
|
||||||
#define _J_CS J_CS_PIN,
|
#define _J_CS J_CS_PIN,
|
||||||
#else
|
#else
|
||||||
#define _J_CS
|
#define _J_CS
|
||||||
|
@ -249,7 +249,7 @@
|
||||||
#else
|
#else
|
||||||
#define _K_MAX
|
#define _K_MAX
|
||||||
#endif
|
#endif
|
||||||
#if PIN_EXISTS(K_CS)
|
#if PIN_EXISTS(K_CS) && AXIS_HAS_SPI(K)
|
||||||
#define _K_CS K_CS_PIN,
|
#define _K_CS K_CS_PIN,
|
||||||
#else
|
#else
|
||||||
#define _K_CS
|
#define _K_CS
|
||||||
|
|
Loading…
Reference in a new issue