From ba8b685ede00a05390b80947ee7a802b481a68aa Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 11 Nov 2025 17:51:51 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Old=20macro?= =?UTF-8?q?s=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/macros.h | 6 ------ Marlin/src/core/types.h | 2 +- Marlin/src/gcode/control/M350_M351.cpp | 2 +- Marlin/src/gcode/host/M114.cpp | 2 +- Marlin/src/inc/SanityCheck.h | 4 ++-- Marlin/src/module/delta.cpp | 2 +- Marlin/src/module/delta.h | 2 +- Marlin/src/module/motion.cpp | 4 ++-- 8 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index d66450f758..29a625dbc3 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -25,12 +25,6 @@ #define __has_include(...) 1 #endif -#define ABCE 4 -#define XYZE 4 -#define ABC 3 -#define XYZ 3 -#define XY 2 - #define _AXIS(A) (A##_AXIS) #define _FORCE_INLINE_ __attribute__((__always_inline__)) __inline__ diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 486f78fde8..520e876315 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -541,7 +541,7 @@ struct XYval { #endif #if HAS_Y_AXIS FI void set(const T px, const T py) { x = px; y = py; } - FI void set(const T (&arr)[XY]) { x = arr[0]; y = arr[1]; } + FI void set(const T (&arr)[2]) { x = arr[0]; y = arr[1]; } #endif #if NUM_AXES > XY FI void set(const T (&arr)[NUM_AXES]) { x = arr[0]; y = arr[1]; } diff --git a/Marlin/src/gcode/control/M350_M351.cpp b/Marlin/src/gcode/control/M350_M351.cpp index 425abad529..76753b2ea9 100644 --- a/Marlin/src/gcode/control/M350_M351.cpp +++ b/Marlin/src/gcode/control/M350_M351.cpp @@ -27,7 +27,7 @@ #include "../gcode.h" #include "../../module/stepper.h" -#if NUM_AXES == XYZ && EXTRUDERS >= 1 +#if NUM_AXES == 3 && EXTRUDERS >= 1 #define HAS_M350_B_PARAM 1 // "5th axis" (after E0) for an original XYZEB setup. #endif diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index 6ec6c2f3ca..35e618e6f2 100644 --- a/Marlin/src/gcode/host/M114.cpp +++ b/Marlin/src/gcode/host/M114.cpp @@ -36,7 +36,7 @@ } SERIAL_EOL(); } - inline void report_linear_axis_pos(const xyze_pos_t &pos) { report_all_axis_pos(pos, XYZ); } + inline void report_linear_axis_pos(const xyze_pos_t &pos) { report_all_axis_pos(pos, 3); } void report_linear_axis_pos(const xyz_pos_t &pos, const uint8_t precision=3) { LOOP_NUM_AXES(a) SERIAL_ECHO(FPSTR(pgm_read_ptr(&SP_AXIS_LBL[a])), p_float_t(pos[a], precision)); diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index c13c0ded82..b8b4a42f40 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -600,7 +600,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #if ENABLED(NOZZLE_PARK_FEATURE) constexpr float npp[] = NOZZLE_PARK_POINT; - static_assert(COUNT(npp) == _MIN(NUM_AXES, XYZ), "NOZZLE_PARK_POINT requires coordinates for enabled axes, but only up to X,Y,Z."); + static_assert(COUNT(npp) == _MIN(NUM_AXES, 3), "NOZZLE_PARK_POINT requires coordinates for enabled axes, but only up to X,Y,Z."); constexpr xyz_pos_t npp_xyz = NOZZLE_PARK_POINT; static_assert(WITHIN(npp_xyz.x, X_MIN_POS, X_MAX_POS), "NOZZLE_PARK_POINT.X is out of bounds (X_MIN_POS, X_MAX_POS)."); static_assert(TERN1(HAS_Y_AXIS, WITHIN(npp_xyz.y, Y_MIN_POS, Y_MAX_POS)), "NOZZLE_PARK_POINT.Y is out of bounds (Y_MIN_POS, Y_MAX_POS)."); @@ -1122,7 +1122,7 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i #error "Leveling in Marlin requires three or more axes, with Z as the vertical axis." #elif ENABLED(CNC_WORKSPACE_PLANES) && !HAS_Z_AXIS #error "CNC_WORKSPACE_PLANES currently requires a Z axis" -#elif ENABLED(DIRECT_STEPPING) && NUM_AXES > XYZ +#elif ENABLED(DIRECT_STEPPING) && NUM_AXES > 3 #error "DIRECT_STEPPING does not currently support more than 3 axes (i.e., XYZ)." #elif ENABLED(FOAMCUTTER_XYUV) && !(HAS_I_AXIS && HAS_J_AXIS) #error "FOAMCUTTER_XYUV requires I and J steppers to be enabled." diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index 2f0415babc..5c913cb5c4 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -56,7 +56,7 @@ float delta_radius, delta_diagonal_rod, segments_per_second; abc_float_t delta_tower_angle_trim; -xy_float_t delta_tower[ABC]; +xy_float_t delta_tower[3]; abc_float_t delta_diagonal_rod_2_tower; float delta_clip_start_height = Z_MAX_POS; abc_float_t delta_diagonal_rod_trim; diff --git a/Marlin/src/module/delta.h b/Marlin/src/module/delta.h index a82f068615..92e647d6d9 100644 --- a/Marlin/src/module/delta.h +++ b/Marlin/src/module/delta.h @@ -34,7 +34,7 @@ extern float delta_radius, delta_diagonal_rod, segments_per_second; extern abc_float_t delta_tower_angle_trim; -extern xy_float_t delta_tower[ABC]; +extern xy_float_t delta_tower[3]; extern abc_float_t delta_diagonal_rod_2_tower; extern float delta_clip_start_height; extern abc_float_t delta_diagonal_rod_trim; diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index cf524cbdb9..34f516c60a 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -120,12 +120,12 @@ xyze_pos_t destination; // {0} #if HAS_HOTEND_OFFSET xyz_pos_t hotend_offset[HOTENDS]; // Initialized by settings.load void reset_hotend_offsets() { - constexpr float tmp[XYZ][HOTENDS] = { HOTEND_OFFSET_X, HOTEND_OFFSET_Y, HOTEND_OFFSET_Z }; + constexpr float tmp[3][HOTENDS] = { HOTEND_OFFSET_X, HOTEND_OFFSET_Y, HOTEND_OFFSET_Z }; static_assert( !tmp[X_AXIS][0] && !tmp[Y_AXIS][0] && !tmp[Z_AXIS][0], "Offsets for the first hotend must be 0.0." ); - // Transpose from [XYZ][HOTENDS] to [HOTENDS][XYZ] + // Transpose from [3][HOTENDS] to [HOTENDS][3] HOTEND_LOOP() LOOP_ABC(a) hotend_offset[e][a] = tmp[a][e]; TERN_(DUAL_X_CARRIAGE, hotend_offset[1].x = _MAX(X2_HOME_POS, X2_MAX_POS)); }