Skip to content

Commit

Permalink
🐛 Followup to 6 linear axes (#22482)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerAndere1 authored Aug 2, 2021
1 parent 1e44704 commit 0eda34e
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 11 deletions.
1 change: 1 addition & 0 deletions Marlin/src/core/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern const char NUL_STR[],
SP_I_LBL[], SP_J_LBL[], SP_K_LBL[],
SP_P_STR[], SP_T_STR[],
X_STR[], Y_STR[], Z_STR[], E_STR[],
I_STR[], J_STR[], K_STR[],
X_LBL[], Y_LBL[], Z_LBL[], E_LBL[],
I_LBL[], J_LBL[], K_LBL[];

Expand Down
26 changes: 24 additions & 2 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,15 @@
#if defined(Z4_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z4)
#define Z4_SENSORLESS 1
#endif
#if defined(I_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(I)
#define I_SENSORLESS 1
#endif
#if defined(J_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(J)
#define J_SENSORLESS 1
#endif
#if defined(K_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(K)
#define K_SENSORLESS 1
#endif

#if AXIS_HAS_STEALTHCHOP(X)
#define X_HAS_STEALTHCHOP 1
Expand Down Expand Up @@ -1845,8 +1854,21 @@

#if ENABLED(SPI_ENDSTOPS)
#define X_SPI_SENSORLESS X_SENSORLESS
#define Y_SPI_SENSORLESS Y_SENSORLESS
#define Z_SPI_SENSORLESS Z_SENSORLESS
#if HAS_Y_AXIS
#define Y_SPI_SENSORLESS Y_SENSORLESS
#endif
#if HAS_Z_AXIS
#define Z_SPI_SENSORLESS Z_SENSORLESS
#endif
#if LINEAR_AXES >= 4
#define I_SPI_SENSORLESS I_SENSORLESS
#endif
#if LINEAR_AXES >= 5
#define J_SPI_SENSORLESS J_SENSORLESS
#endif
#if LINEAR_AXES >= 6
#define K_SPI_SENSORLESS K_SENSORLESS
#endif
#endif
#ifndef X_INTERPOLATE
#define X_INTERPOLATE INTERPOLATE
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/menu/menu_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,13 @@ void menu_motion() {
GCODES_ITEM(MSG_AUTO_HOME_Z, PSTR("G28Z"));
#endif
#if LINEAR_AXES >= 4
GCODES_ITEM(MSG_AUTO_HOME_I, PSTR("G28" I_STR));
GCODES_ITEM(MSG_AUTO_HOME_I, PSTR("G28" AXIS4_STR));
#endif
#if LINEAR_AXES >= 5
GCODES_ITEM(MSG_AUTO_HOME_J, PSTR("G28" J_STR));
GCODES_ITEM(MSG_AUTO_HOME_J, PSTR("G28" AXIS5_STR));
#endif
#if LINEAR_AXES >= 6
GCODES_ITEM(MSG_AUTO_HOME_K, PSTR("G28" K_STR));
GCODES_ITEM(MSG_AUTO_HOME_K, PSTR("G28" AXIS6_STR));
#endif
#endif

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/module/endstops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ void Endstops::update() {
#endif
#endif

#if HAS_I_MIN
#if HAS_I_MIN && !I_SPI_SENSORLESS
#if ENABLED(I_DUAL_ENDSTOPS)
UPDATE_ENDSTOP_BIT(I, MIN);
#if HAS_I2_MIN
Expand All @@ -767,7 +767,7 @@ void Endstops::update() {
#endif
#endif

#if HAS_I_MAX
#if HAS_I_MAX && !I_SPI_SENSORLESS
#if ENABLED(I_DUAL_ENDSTOPS)
UPDATE_ENDSTOP_BIT(I, MAX);
#if HAS_I2_MAX
Expand All @@ -780,7 +780,7 @@ void Endstops::update() {
#endif
#endif

#if HAS_J_MIN
#if HAS_J_MIN && !J_SPI_SENSORLESS
#if ENABLED(J_DUAL_ENDSTOPS)
UPDATE_ENDSTOP_BIT(J, MIN);
#if HAS_J2_MIN
Expand All @@ -793,7 +793,7 @@ void Endstops::update() {
#endif
#endif

#if HAS_J_MAX
#if HAS_J_MAX && !J_SPI_SENSORLESS
#if ENABLED(J_DUAL_ENDSTOPS)
UPDATE_ENDSTOP_BIT(J, MAX);
#if HAS_J2_MAX
Expand All @@ -806,7 +806,7 @@ void Endstops::update() {
#endif
#endif

#if HAS_K_MIN
#if HAS_K_MIN && !K_SPI_SENSORLESS
#if ENABLED(K_DUAL_ENDSTOPS)
UPDATE_ENDSTOP_BIT(K, MIN);
#if HAS_K2_MIN
Expand All @@ -819,7 +819,7 @@ void Endstops::update() {
#endif
#endif

#if HAS_K_MAX
#if HAS_K_MAX && !K_SPI_SENSORLESS
#if ENABLED(K_DUAL_ENDSTOPS)
UPDATE_ENDSTOP_BIT(K, MAX);
#if HAS_K2_MAX
Expand Down
9 changes: 9 additions & 0 deletions Marlin/src/module/endstops.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ enum EndstopEnum : char {
#if HAS_Z_MIN || HAS_Z_MAX || HOMING_Z_WITH_PROBE
, Z_ENDSTOP = TERN(Z_HOME_TO_MAX, Z_MAX, TERN(HOMING_Z_WITH_PROBE, Z_MIN_PROBE, Z_MIN))
#endif
#if HAS_I_MIN || HAS_I_MAX
, I_ENDSTOP = TERN(I_HOME_TO_MAX, I_MAX, I_MIN)
#endif
#if HAS_J_MIN || HAS_J_MAX
, J_ENDSTOP = TERN(J_HOME_TO_MAX, J_MAX, J_MIN)
#endif
#if HAS_K_MIN || HAS_K_MAX
, K_ENDSTOP = TERN(K_HOME_TO_MAX, K_MAX, K_MIN)
#endif
};

#undef __ES_ITEM
Expand Down

0 comments on commit 0eda34e

Please sign in to comment.