🧑‍💻 MAP macro for axis lists, etc. (#24191)

This commit is contained in:
Scott Lahteine
2022-05-22 16:08:29 -05:00
committed by Scott Lahteine
parent ecfe7b6400
commit 3c482a9ba1
11 changed files with 57 additions and 83 deletions

View File

@ -738,10 +738,12 @@ void restore_feedrate_and_scaling() {
#if HAS_SOFTWARE_ENDSTOPS
// Software Endstops are based on the configured limits.
#define _AMIN(A) A##_MIN_POS
#define _AMAX(A) A##_MAX_POS
soft_endstops_t soft_endstop = {
true, false,
NUM_AXIS_ARRAY(X_MIN_POS, Y_MIN_POS, Z_MIN_POS, I_MIN_POS, J_MIN_POS, K_MIN_POS, U_MIN_POS, V_MIN_POS, W_MIN_POS),
NUM_AXIS_ARRAY(X_MAX_BED, Y_MAX_BED, Z_MAX_POS, I_MAX_POS, J_MAX_POS, K_MAX_POS, U_MAX_POS, V_MAX_POS, W_MAX_POS)
{ MAPLIST(_AMIN, MAIN_AXIS_NAMES) },
{ MAPLIST(_AMAX, MAIN_AXIS_NAMES) },
};
/**
@ -1888,17 +1890,8 @@ void prepare_line_to_destination() {
|| TERN0(A##_HOME_TO_MIN, A##_MIN_PIN > -1) \
|| TERN0(A##_HOME_TO_MAX, A##_MAX_PIN > -1) \
))
if (NUM_AXIS_GANG(
!_CAN_HOME(X),
&& !_CAN_HOME(Y),
&& !_CAN_HOME(Z),
&& !_CAN_HOME(I),
&& !_CAN_HOME(J),
&& !_CAN_HOME(K),
&& !_CAN_HOME(U),
&& !_CAN_HOME(V),
&& !_CAN_HOME(W))
) return;
#define _ANDCANT(N) && !_CAN_HOME(N)
if (true MAIN_AXIS_MAP(_ANDCANT)) return;
#endif
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM(">>> homeaxis(", AS_CHAR(AXIS_CHAR(axis)), ")");