Skip to content

Commit

Permalink
Cleanup, fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Sep 23, 2021
1 parent 5ecb901 commit df6c9e6
Show file tree
Hide file tree
Showing 31 changed files with 231 additions and 697 deletions.
42 changes: 20 additions & 22 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,16 @@
#define ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// Disable ENDSTOPPULLUPS to set pullups individually
//#define ENDSTOPPULLUP_XMIN
//#define ENDSTOPPULLUP_YMIN
//#define ENDSTOPPULLUP_ZMIN
//#define ENDSTOPPULLUP_IMIN
//#define ENDSTOPPULLUP_JMIN
//#define ENDSTOPPULLUP_KMIN
//#define ENDSTOPPULLUP_MMIN
//#define ENDSTOPPULLUP_OMIN
//#define ENDSTOPPULLUP_PMIN
//#define ENDSTOPPULLUP_QMIN
//#define ENDSTOPPULLUP_XMAX
//#define ENDSTOPPULLUP_YMAX
//#define ENDSTOPPULLUP_ZMAX
Expand All @@ -823,34 +833,13 @@
//#define ENDSTOPPULLUP_OMAX
//#define ENDSTOPPULLUP_PMAX
//#define ENDSTOPPULLUP_QMAX
//#define ENDSTOPPULLUP_XMIN
//#define ENDSTOPPULLUP_YMIN
//#define ENDSTOPPULLUP_ZMIN
//#define ENDSTOPPULLUP_IMIN
//#define ENDSTOPPULLUP_JMIN
//#define ENDSTOPPULLUP_KMIN
//#define ENDSTOPPULLUP_MMIN
//#define ENDSTOPPULLUP_OMIN
//#define ENDSTOPPULLUP_OMIN
//#define ENDSTOPPULLUP_QMIN
//#define ENDSTOPPULLUP_ZMIN_PROBE
#endif

// Enable pulldown for all endstops to prevent a floating state
//#define ENDSTOPPULLDOWNS
#if DISABLED(ENDSTOPPULLDOWNS)
// Disable ENDSTOPPULLDOWNS to set pulldowns individually
//#define ENDSTOPPULLDOWN_XMAX
//#define ENDSTOPPULLDOWN_YMAX
//#define ENDSTOPPULLDOWN_ZMAX
//#define ENDSTOPPULLDOWN_IMAX
//#define ENDSTOPPULLDOWN_JMAX
//#define ENDSTOPPULLDOWN_KMAX
//#define ENDSTOPPULLDOWN_KMAX
//#define ENDSTOPPULLDOWN_MMAX
//#define ENDSTOPPULLDOWN_OMAX
//#define ENDSTOPPULLDOWN_PMAX
//#define ENDSTOPPULLDOWN_QMAX
//#define ENDSTOPPULLDOWN_XMIN
//#define ENDSTOPPULLDOWN_YMIN
//#define ENDSTOPPULLDOWN_ZMIN
Expand All @@ -861,6 +850,16 @@
//#define ENDSTOPPULLDOWN_OMIN
//#define ENDSTOPPULLDOWN_PMIN
//#define ENDSTOPPULLDOWN_QMIN
//#define ENDSTOPPULLDOWN_XMAX
//#define ENDSTOPPULLDOWN_YMAX
//#define ENDSTOPPULLDOWN_ZMAX
//#define ENDSTOPPULLDOWN_IMAX
//#define ENDSTOPPULLDOWN_JMAX
//#define ENDSTOPPULLDOWN_KMAX
//#define ENDSTOPPULLDOWN_MMAX
//#define ENDSTOPPULLDOWN_OMAX
//#define ENDSTOPPULLDOWN_PMAX
//#define ENDSTOPPULLDOWN_QMAX
//#define ENDSTOPPULLDOWN_ZMIN_PROBE
#endif

Expand Down Expand Up @@ -920,7 +919,6 @@
//#define O_DRIVER_TYPE A4988
//#define P_DRIVER_TYPE A4988
//#define Q_DRIVER_TYPE A4988
//#define E0_DRIVER_TYPE A4988
#define E0_DRIVER_TYPE A4988
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
Expand Down
76 changes: 38 additions & 38 deletions Marlin/src/core/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,44 +33,44 @@

#define _AXIS(A) (A##_AXIS)

#define _XMIN_ 100
#define _YMIN_ 200
#define _ZMIN_ 300
#define _IMIN_ 500
#define _JMIN_ 600
#define _KMIN_ 700
#define _MMIN_ 800
#define _OMIN_ 900
#define _PMIN_ 1000
#define _QMIN_ 1100
#define _XMAX_ 101
#define _YMAX_ 201
#define _ZMAX_ 301
#define _IMAX_ 501
#define _JMAX_ 601
#define _KMAX_ 701
#define _MMAX_ 801
#define _OMAX_ 901
#define _PMAX_ 1001
#define _QMAX_ 1101
#define _XDIAG_ 102
#define _YDIAG_ 202
#define _ZDIAG_ 302
#define _IDIAG_ 502
#define _JDIAG_ 602
#define _KDIAG_ 702
#define _MDIAG_ 802
#define _ODIAG_ 902
#define _PDIAG_ 1002
#define _QDIAG_ 1102
#define _E0DIAG_ 400
#define _E1DIAG_ 401
#define _E2DIAG_ 402
#define _E3DIAG_ 403
#define _E4DIAG_ 404
#define _E5DIAG_ 405
#define _E6DIAG_ 406
#define _E7DIAG_ 407
#define _XMIN_ 0x11
#define _YMIN_ 0x12
#define _ZMIN_ 0x13
#define _IMIN_ 0x14
#define _JMIN_ 0x15
#define _KMIN_ 0x16
#define _MMIN_ 0x17
#define _OMIN_ 0x18
#define _PMIN_ 0x19
#define _QMIN_ 0x1A
#define _XMAX_ 0x21
#define _YMAX_ 0x22
#define _ZMAX_ 0x23
#define _IMAX_ 0x24
#define _JMAX_ 0x25
#define _KMAX_ 0x26
#define _MMAX_ 0x27
#define _OMAX_ 0x28
#define _PMAX_ 0x29
#define _QMAX_ 0x2A
#define _XDIAG_ 0x31
#define _YDIAG_ 0x32
#define _ZDIAG_ 0x33
#define _IDIAG_ 0x34
#define _JDIAG_ 0x35
#define _KDIAG_ 0x36
#define _MDIAG_ 0x37
#define _ODIAG_ 0x38
#define _PDIAG_ 0x39
#define _QDIAG_ 0x3A
#define _E0DIAG_ 0xE0
#define _E1DIAG_ 0xE1
#define _E2DIAG_ 0xE2
#define _E3DIAG_ 0xE3
#define _E4DIAG_ 0xE4
#define _E5DIAG_ 0xE5
#define _E6DIAG_ 0xE6
#define _E7DIAG_ 0xE7

#define _FORCE_INLINE_ __attribute__((__always_inline__)) __inline__
#define FORCE_INLINE __attribute__((always_inline)) inline
Expand Down
30 changes: 17 additions & 13 deletions Marlin/src/core/serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,24 @@
uint8_t marlin_debug_flags = MARLIN_DEBUG_NONE;

// Commonly-used strings in serial output
PGMSTR(NUL_STR, ""); PGMSTR(SP_PLETTER_STR, " P"); PGMSTR(SP_T_STR, " T");
PGMSTR(X_STR, "X"); PGMSTR(Y_STR, "Y"); PGMSTR(Z_STR, "Z"); PGMSTR(E_STR, "E");
PGMSTR(I_STR, AXIS4_STR); PGMSTR(J_STR, AXIS5_STR); PGMSTR(K_STR, AXIS6_STR);
PGMSTR(M_STR, AXIS7_STR); PGMSTR(O_STR, AXIS8_STR); PGMSTR(P_STR, AXIS9_STR); PGMSTR(Q_STR, AXIS10_STR);
PGMSTR(X_LBL, "X:"); PGMSTR(Y_LBL, "Y:"); PGMSTR(Z_LBL, "Z:"); PGMSTR(E_LBL, "E:");
PGMSTR(I_LBL, AXIS4_STR ":"); PGMSTR(J_LBL, AXIS5_STR ":"); PGMSTR(K_LBL, AXIS6_STR ":");
PGMSTR(M_LBL, AXIS7_STR ":"); PGMSTR(O_LBL, AXIS8_STR ":"); PGMSTR(P_LBL, AXIS9_STR ":"); PGMSTR(Q_LBL, AXIS10_STR ":");
PGMSTR(SP_X_STR, " X"); PGMSTR(SP_Y_STR, " Y"); PGMSTR(SP_Z_STR, " Z"); PGMSTR(SP_E_STR, " E");
PGMSTR(SP_I_STR, " " AXIS4_STR); PGMSTR(SP_J_STR, " " AXIS5_STR); PGMSTR(SP_K_STR, " " AXIS6_STR);
PGMSTR(SP_M_STR, " " AXIS7_STR); PGMSTR(SP_O_STR, " " AXIS8_STR); PGMSTR(SP_P_STR, " " AXIS9_STR); PGMSTR(SP_Q_STR, " " AXIS10_STR);
PGMSTR(SP_X_LBL, " X:"); PGMSTR(SP_Y_LBL, " Y:"); PGMSTR(SP_Z_LBL, " Z:"); PGMSTR(SP_E_LBL, " E:");
PGMSTR(SP_A_STR, " A"); PGMSTR(SP_B_STR, " B"); PGMSTR(SP_C_STR, " C");
PGMSTR(NUL_STR, ""); PGMSTR(SP_T_STR, " T");
PGMSTR(SP_A_STR, " A"); PGMSTR(SP_B_STR, " B"); PGMSTR(SP_C_STR, " C");
PGMSTR(SP_X_STR, " X"); PGMSTR(SP_Y_STR, " Y"); PGMSTR(SP_Z_STR, " Z");
PGMSTR(SP_I_STR, " " AXIS4_STR); PGMSTR(SP_J_STR, " " AXIS5_STR); PGMSTR(SP_K_STR, " " AXIS6_STR);
PGMSTR(SP_M_STR, " " AXIS7_STR); PGMSTR(SP_O_STR, " " AXIS8_STR); PGMSTR(SP_P_STR, " " AXIS9_STR);
PGMSTR(SP_Q_STR, " " AXIS10_STR); PGMSTR(SP_E_STR, " E");
PGMSTR(SP_X_LBL, " X:"); PGMSTR(SP_Y_LBL, " Y:"); PGMSTR(SP_Z_LBL, " Z:");
PGMSTR(SP_I_LBL, " " AXIS4_STR ":"); PGMSTR(SP_J_LBL, " " AXIS5_STR ":"); PGMSTR(SP_K_LBL, " " AXIS6_STR ":");
PGMSTR(SP_M_LBL, " " AXIS7_STR ":"); PGMSTR(SP_O_LBL, " " AXIS8_STR ":"); PGMSTR(SP_P_LBL, " " AXIS9_STR ":"); PGMSTR(SP_Q_LBL, " " AXIS10_STR ":");
PGMSTR(SP_M_LBL, " " AXIS7_STR ":"); PGMSTR(SP_O_LBL, " " AXIS8_STR ":"); PGMSTR(SP_P_LBL, " " AXIS9_STR ":");
PGMSTR(SP_Q_LBL, " " AXIS10_STR ":"); PGMSTR(SP_E_LBL, " E:");
PGMSTR(X_STR, "X"); PGMSTR(Y_STR, "Y"); PGMSTR(Z_STR, "Z");
PGMSTR(I_STR, AXIS4_STR); PGMSTR(J_STR, AXIS5_STR); PGMSTR(K_STR, AXIS6_STR);
PGMSTR(M_STR, AXIS7_STR); PGMSTR(O_STR, AXIS8_STR); PGMSTR(P_STR, AXIS9_STR);
PGMSTR(Q_STR, AXIS10_STR); PGMSTR(E_STR, "E");
PGMSTR(X_LBL, "X:"); PGMSTR(Y_LBL, "Y:"); PGMSTR(Z_LBL, "Z:");
PGMSTR(I_LBL, AXIS4_STR ":"); PGMSTR(J_LBL, AXIS5_STR ":"); PGMSTR(K_LBL, AXIS6_STR ":");
PGMSTR(M_LBL, AXIS7_STR ":"); PGMSTR(O_LBL, AXIS8_STR ":"); PGMSTR(P_LBL, AXIS9_STR ":");
PGMSTR(Q_LBL, AXIS10_STR ":"); PGMSTR(E_LBL, "E:");

// Hook Meatpack if it's enabled on the first leaf
#if ENABLED(MEATPACK_ON_SERIAL_PORT_1)
Expand Down
21 changes: 6 additions & 15 deletions Marlin/src/core/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,12 @@
#endif

// Commonly-used strings in serial output
extern const char NUL_STR[],
SP_X_STR[], SP_Y_STR[], SP_Z_STR[],
SP_A_STR[], SP_B_STR[], SP_C_STR[], SP_E_STR[],
SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_E_LBL[],
SP_I_STR[], SP_J_STR[], SP_K_STR[],
SP_M_STR[], SP_O_STR[], SP_P_STR[], SP_Q_STR[],
SP_I_LBL[], SP_J_LBL[], SP_K_LBL[],
SP_M_LBL[], SP_O_LBL[], SP_P_LBL[], SP_Q_LBL[],
SP_PLETTER_STR[], SP_T_STR[],
X_STR[], Y_STR[], Z_STR[], E_STR[],
I_STR[], J_STR[], K_STR[],
M_STR[], O_STR[], P_STR[], Q_STR[],
X_LBL[], Y_LBL[], Z_LBL[], E_LBL[],
I_LBL[], J_LBL[], K_LBL[],
M_LBL[], O_LBL[], P_LBL[], Q_LBL[];
extern const char NUL_STR[], SP_T_STR[],
SP_A_STR[], SP_B_STR[], SP_C_STR[],
SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_I_STR[], SP_J_STR[], SP_K_STR[], SP_M_STR[], SP_O_STR[], SP_P_STR[], SP_Q_STR[], SP_E_STR[],
SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_I_LBL[], SP_J_LBL[], SP_K_LBL[], SP_M_LBL[], SP_O_LBL[], SP_P_LBL[], SP_Q_LBL[], SP_E_LBL[],
X_STR[], Y_STR[], Z_STR[], I_STR[], J_STR[], K_STR[], M_STR[], O_STR[], P_STR[], Q_STR[], E_STR[],
X_LBL[], Y_LBL[], Z_LBL[], I_LBL[], J_LBL[], K_LBL[], M_LBL[], O_LBL[], P_LBL[], Q_LBL[], E_LBL[];

//
// Debugging flags for use by M111
Expand Down
13 changes: 7 additions & 6 deletions Marlin/src/core/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ enum AxisEnum : uint8_t {

typedef IF<(NUM_AXIS_ENUMS > 8), uint16_t, uint8_t>::type axis_bits_t;
typedef IF<(LINEAR_AXES > 8), uint16_t, uint8_t>::type linear_axis_bits_t;

//
// Loop over axes
//
Expand Down Expand Up @@ -290,8 +291,8 @@ struct XYval {
FI XYval<float> reciprocal() const { return { _RECIP(x), _RECIP(y) }; }

// Marlin workspace shifting is done with G92 and M206
FI XYval<float> asLogical() const { XYval<float> obj = asFloat(); toLogical(obj); return obj; }
FI XYval<float> asNative() const { XYval<float> obj = asFloat(); toNative(obj); return obj; }
FI XYval<float> asLogical() const { XYval<float> o = asFloat(); toLogical(o); return o; }
FI XYval<float> asNative() const { XYval<float> o = asFloat(); toNative(o); return o; }

// Cast to a type with more fields by making a new object
FI operator XYZval<T>() { return { x, y }; }
Expand Down Expand Up @@ -345,8 +346,8 @@ struct XYval {
FI XYval<T> operator>>(const int &v) { XYval<T> ls = *this; _RS(ls.x); _RS(ls.y); return ls; }
FI XYval<T> operator<<(const int &v) const { XYval<T> ls = *this; _LS(ls.x); _LS(ls.y); return ls; }
FI XYval<T> operator<<(const int &v) { XYval<T> ls = *this; _LS(ls.x); _LS(ls.y); return ls; }
FI const XYval<T> operator-() const { XYval<T> obj = *this; obj.x = -x; obj.y = -y; return obj; }
FI XYval<T> operator-() { XYval<T> obj = *this; obj.x = -x; obj.y = -y; return obj; }
FI const XYval<T> operator-() const { XYval<T> o = *this; o.x = -x; o.y = -y; return o; }
FI XYval<T> operator-() { XYval<T> o = *this; o.x = -x; o.y = -y; return o; }

// Modifier operators
FI XYval<T>& operator+=(const XYval<T> &rs) { x += rs.x; y += rs.y; return *this; }
Expand Down Expand Up @@ -440,7 +441,7 @@ struct XYZval {

// Explicit copy and copies with conversion
FI XYZval<T> copy() const { XYZval<T> obj = *this; return obj; }
FI XYZval<T> ABS() const { return LINEAR_AXIS_ARRAY(T(_ABS(x)), T(_ABS(y)), T(_ABS(z)), T(_ABS(i)), T(_ABS(j)), T(_ABS(k), T(_ABS(m)), T(_ABS(o)), T(_ABS(p)), T(_ABS(q))); }
FI XYZval<T> ABS() const { return LINEAR_AXIS_ARRAY(T(_ABS(x)), T(_ABS(y)), T(_ABS(z)), T(_ABS(i)), T(_ABS(j)), T(_ABS(k)), T(_ABS(m)), T(_ABS(o)), T(_ABS(p)), T(_ABS(q))); }
FI XYZval<int16_t> asInt() { return LINEAR_AXIS_ARRAY(int16_t(x), int16_t(y), int16_t(z), int16_t(i), int16_t(j), int16_t(k), int16_t(m), int16_t(o), int16_t(p), int16_t(q)); }
FI XYZval<int16_t> asInt() const { return LINEAR_AXIS_ARRAY(int16_t(x), int16_t(y), int16_t(z), int16_t(i), int16_t(j), int16_t(k), int16_t(m), int16_t(o), int16_t(p), int16_t(q)); }
FI XYZval<int32_t> asLong() { return LINEAR_AXIS_ARRAY(int32_t(x), int32_t(y), int32_t(z), int32_t(i), int32_t(j), int32_t(k), int32_t(m), int32_t(o), int32_t(p), int32_t(q)); }
Expand Down Expand Up @@ -594,7 +595,7 @@ struct XYZEval {

// Explicit copy and copies with conversion
FI XYZEval<T> copy() const { XYZEval<T> o = *this; return o; }
FI XYZEval<T> ABS() const { return LOGICAL_AXIS_ARRAY(T(_ABS(e)), T(_ABS(x)), T(_ABS(y)), T(_ABS(z)), T(_ABS(i)), T(_ABS(j)), T(_ABS(k)), T(_ABS(m)), T(_ABS(o)), (_ABS(p)), T(_ABS(q)); }
FI XYZEval<T> ABS() const { return LOGICAL_AXIS_ARRAY(T(_ABS(e)), T(_ABS(x)), T(_ABS(y)), T(_ABS(z)), T(_ABS(i)), T(_ABS(j)), T(_ABS(k)), T(_ABS(m)), T(_ABS(o)), T(_ABS(p)), T(_ABS(q))); }
FI XYZEval<int16_t> asInt() { return LOGICAL_AXIS_ARRAY(int16_t(e), int16_t(x), int16_t(y), int16_t(z), int16_t(i), int16_t(j), int16_t(k), int16_t(m), int16_t(o), int16_t(p), int16_t(q)); }
FI XYZEval<int16_t> asInt() const { return LOGICAL_AXIS_ARRAY(int16_t(e), int16_t(x), int16_t(y), int16_t(z), int16_t(i), int16_t(j), int16_t(k), int16_t(m), int16_t(o), int16_t(p), int16_t(q)); }
FI XYZEval<int32_t> asLong() { return LOGICAL_AXIS_ARRAY(int32_t(e), int32_t(x), int32_t(y), int32_t(z), int32_t(i), int32_t(j), int32_t(k), int32_t(m), int32_t(o), int32_t(p), int32_t(q)); }
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/backlash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Backlash backlash;
* spread over multiple segments, smoothing out artifacts even more.
*/

void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const uint8_t dm, block_t * const block) {
void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const axis_bits_t dm, block_t * const block) {
static axis_bits_t last_direction_bits;
axis_bits_t changed_dir = last_direction_bits ^ dm;
// Ignore direction change unless steps are taken in that direction
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/backlash.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Backlash {
return has_measurement(X_AXIS) || has_measurement(Y_AXIS) || has_measurement(Z_AXIS);
}

void add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const uint8_t dm, block_t * const block);
void add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const axis_bits_t dm, block_t * const block);
};

extern Backlash backlash;
2 changes: 1 addition & 1 deletion Marlin/src/feature/stepper_driver_safety.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void stepper_driver_backward_check() {
void stepper_driver_backward_report() {
if (!axis_plug_backward) return;

auto _report_if_backward = [](PGM_P axis, axis_bit_t bit) {
auto _report_if_backward = [](PGM_P axis, uint8_t bit) {
if (TEST(axis_plug_backward, bit))
stepper_driver_backward_error(axis);
};
Expand Down
19 changes: 0 additions & 19 deletions Marlin/src/feature/tmc_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,29 +335,14 @@ void tmc_print_current(TMC &st) {
#endif

void monitor_tmc_drivers();
<<<<<<< Upstream, based on origin/bugfix-2.0.x
void test_tmc_connection(LOGICAL_AXIS_DECL(const bool, true));
=======
void test_tmc_connection(
LOGICAL_AXIS_LIST(const bool test_e=true, const bool test_x=true, const bool test_y=true, const bool test_z=true, const bool test_i=true, const bool test_j=true, const bool test_k=true, const bool test_m=true, const bool test_o=true, const bool test_p=true, const bool test_q=true)
);
>>>>>>> 17f4b41 Up to 9 Axis Working. (X, Y, Z, A, B, C, D, U, E0)

#if ENABLED(TMC_DEBUG)
#if ENABLED(MONITOR_DRIVER_STATUS)
void tmc_set_report_interval(const uint16_t update_interval);
#endif
<<<<<<< Upstream, based on origin/bugfix-2.0.x
void tmc_report_all(LOGICAL_AXIS_DECL(const bool, true));
void tmc_get_registers(LOGICAL_AXIS_ARGS(const bool));
=======
void tmc_report_all(
LOGICAL_AXIS_LIST(const bool print_e=true, const bool print_x=true, const bool print_y=true, const bool print_z=true, const bool print_i=true, const bool print_j=true, const bool print_k=true, const bool test_m=true, const bool test_o=true, const bool test_p=true, const bool test_q=true)
);
void tmc_get_registers(
LOGICAL_AXIS_LIST(const bool print_e, const bool print_x, const bool print_y, const bool print_z, const bool print_i, const bool print_j, const bool print_k, const bool print_m, const bool print_o, const bool print_p, const bool print_q)
);
>>>>>>> 17f4b41 Up to 9 Axis Working. (X, Y, Z, A, B, C, D, U, E0)
#endif

/**
Expand All @@ -370,11 +355,7 @@ void test_tmc_connection(
#if USE_SENSORLESS

// Track enabled status of stealthChop and only re-enable where applicable
<<<<<<< Upstream, based on origin/bugfix-2.0.x
struct sensorless_t { bool LINEAR_AXIS_ARGS(), x2, y2, z2, z3, z4; };
=======
struct sensorless_t { bool LINEAR_AXIS_LIST(x, y, z, i, j, k, m, o, p, q), x2, y2, z2, z3, z4; };
>>>>>>> 17f4b41 Up to 9 Axis Working. (X, Y, Z, A, B, C, D, U, E0)

#if ENABLED(IMPROVE_HOMING_RELIABILITY)
extern millis_t sg_guard_period;
Expand Down
15 changes: 9 additions & 6 deletions Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,17 +384,20 @@ void GcodeSuite::G28() {
homeX = needX || parser.seen_test('X'),
homeY = needY || parser.seen_test('Y'),
homeZZ = homeZ,
homeI = needI || parser.seen_test(AXIS4_NAME), homeJ = needJ || parser.seen_test(AXIS5_NAME), homeK = needK || parser.seen_test(AXIS6_NAME),
homeM = needM || parser.seen_test(AXIS7_NAME), homeO = needO || parser.seen_test(AXIS8_NAME), homeP = needP || parser.seen_test(AXIS9_NAME), homeQ = needQ || parser.seen_test(AXIS10_NAME),
homeI = needI || parser.seen_test(AXIS4_NAME), homeJ = needJ || parser.seen_test(AXIS5_NAME),
homeK = needK || parser.seen_test(AXIS6_NAME), homeM = needM || parser.seen_test(AXIS7_NAME),
homeO = needO || parser.seen_test(AXIS8_NAME), homeP = needP || parser.seen_test(AXIS9_NAME),
homeQ = needQ || parser.seen_test(AXIS10_NAME),
),
home_all = LINEAR_AXIS_GANG( // Home-all if all or none are flagged
homeX == homeX, && homeY == homeX, && homeZ == homeX,
&& homeI == homeX, && homeJ == homeX, && homeK == homeX
&& homeM == homeM, && homeO == homeO, && homeP == homeP, && homeQ == homeQ
&& homeI == homeX, && homeJ == homeX, && homeK == homeX,
&& homeM == homeX, && homeO == homeX, && homeP == homeX, && homeQ == homeX
),
LINEAR_AXIS_LIST(
doX = home_all || homeX, doY = home_all || homeY, doZ = home_all || homeZ,
doI = home_all || homeI, doJ = home_all || homeJ, doK = home_all || homeK
doI = home_all || homeI, doJ = home_all || homeJ, doK = home_all || homeK,
doM = home_all || homeM, doO = home_all || homeO, doP = home_all || homeP, doQ = home_all || homeQ
);

#if HAS_Z_AXIS
Expand All @@ -407,7 +410,7 @@ void GcodeSuite::G28() {

const float z_homing_height = parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT;

if (z_homing_height && (LINEAR_AXIS_GANG(doX, || doY, || TERN0(Z_SAFE_HOMING, doZ), || doI, || doJ, || doK, || doI, || doJ, || doK, || doM, || doO, || doP, || doQ))) {
if (z_homing_height && (LINEAR_AXIS_GANG(doX, || doY, || TERN0(Z_SAFE_HOMING, doZ), || doI, || doJ, || doK, || doM, || doO, || doP, || doQ))) {
// Raise Z before homing any other axes and z is not already high enough (never lower z)
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Raise Z (before homing) by ", z_homing_height);
do_z_clearance(z_homing_height);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/calibrate/M425.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void GcodeSuite::M425() {
case M_AXIS: return AXIS_CAN_CALIBRATE(M),
case O_AXIS: return AXIS_CAN_CALIBRATE(O),
case P_AXIS: return AXIS_CAN_CALIBRATE(P),
case Q_AXIS: return AXIS_CAN_CALIBRATE(Q),
case Q_AXIS: return AXIS_CAN_CALIBRATE(Q)
);
}
};
Expand Down
Loading

0 comments on commit df6c9e6

Please sign in to comment.