From cdbd438a041427580eaea0a9fbe570864aed70d0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 21 May 2021 08:25:54 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Rename=20all/no=20axis=20enums?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/types.h | 2 +- Marlin/src/gcode/calibrate/M852.cpp | 2 +- Marlin/src/gcode/probe/G38.cpp | 2 +- Marlin/src/lcd/marlinui.cpp | 12 ++++++------ Marlin/src/lcd/menu/menu_bed_leveling.cpp | 2 +- Marlin/src/lcd/menu/menu_ubl.cpp | 2 +- Marlin/src/module/motion.cpp | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 98e2bedb00..b7ae85eb2e 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -54,7 +54,7 @@ enum AxisEnum : uint8_t { X_HEAD, Y_HEAD, Z_HEAD, E0_AXIS = E_AXIS, E1_AXIS, E2_AXIS, E3_AXIS, E4_AXIS, E5_AXIS, E6_AXIS, E7_AXIS, - ALL_AXES_MASK = 0xFE, NO_AXIS_MASK = 0xFF + ALL_AXES_ENUM = 0xFE, NO_AXIS_ENUM = 0xFF }; // diff --git a/Marlin/src/gcode/calibrate/M852.cpp b/Marlin/src/gcode/calibrate/M852.cpp index a038dc59fd..6f1e984bc3 100644 --- a/Marlin/src/gcode/calibrate/M852.cpp +++ b/Marlin/src/gcode/calibrate/M852.cpp @@ -86,7 +86,7 @@ void GcodeSuite::M852() { // When skew is changed the current position changes if (setval) { - set_current_from_steppers_for_axis(ALL_AXES_MASK); + set_current_from_steppers_for_axis(ALL_AXES_ENUM); sync_plan_position(); report_current_position(); } diff --git a/Marlin/src/gcode/probe/G38.cpp b/Marlin/src/gcode/probe/G38.cpp index 606776f402..6906805fca 100644 --- a/Marlin/src/gcode/probe/G38.cpp +++ b/Marlin/src/gcode/probe/G38.cpp @@ -38,7 +38,7 @@ inline void G38_single_probe(const uint8_t move_value) { planner.synchronize(); G38_move = 0; endstops.hit_on_purpose(); - set_current_from_steppers_for_axis(ALL_AXES_MASK); + set_current_from_steppers_for_axis(ALL_AXES_ENUM); sync_plan_position(); } diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 544cc5eb2c..c99fa41657 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -684,7 +684,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { #if ENABLED(MULTI_E_MANUAL) int8_t ManualMove::e_index = 0; #endif - AxisEnum ManualMove::axis = NO_AXIS_MASK; + AxisEnum ManualMove::axis = NO_AXIS_ENUM; /** * If a manual move has been posted and its time has arrived, and if the planner @@ -695,7 +695,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { * * To post a manual move: * - Update current_position to the new place you want to go. - * - Set manual_move.axis to an axis like X_AXIS. Use ALL_AXES_MASK for diagonal moves. + * - Set manual_move.axis to an axis like X_AXIS. Use ALL_AXES_ENUM for diagonal moves. * - Set manual_move.start_time to a point in the future (in ms) when the move should be done. * * For kinematic machines: @@ -710,7 +710,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { if (processing) return; // Prevent re-entry from idle() calls // Add a manual move to the queue? - if (axis != NO_AXIS_MASK && ELAPSED(millis(), start_time) && !planner.is_full()) { + if (axis != NO_AXIS_ENUM && ELAPSED(millis(), start_time) && !planner.is_full()) { const feedRate_t fr_mm_s = (axis <= E_AXIS) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S; @@ -722,7 +722,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { #endif // Apply a linear offset to a single axis - if (axis == ALL_AXES_MASK) + if (axis == ALL_AXES_ENUM) destination = all_axes_destination; else if (axis <= XYZE) { destination = current_position; @@ -731,7 +731,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { // Reset for the next move offset = 0; - axis = NO_AXIS_MASK; + axis = NO_AXIS_ENUM; // DELTA and SCARA machines use segmented moves, which could fill the planner during the call to // move_to_destination. This will cause idle() to be called, which can then call this function while the @@ -748,7 +748,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { //SERIAL_ECHOLNPAIR("Add planner.move with Axis ", AS_CHAR(axis_codes[axis]), " at FR ", fr_mm_s); - axis = NO_AXIS_MASK; + axis = NO_AXIS_ENUM; #endif } diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index 70de53dab5..62cf8cf1c1 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -206,7 +206,7 @@ #if ENABLED(MESH_EDIT_MENU) inline void refresh_planner() { - set_current_from_steppers_for_axis(ALL_AXES_MASK); + set_current_from_steppers_for_axis(ALL_AXES_ENUM); sync_plan_position(); } diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index f923f98c78..880b76ff76 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -430,7 +430,7 @@ void ubl_map_move_to_xy() { // Use the built-in manual move handler to move to the mesh point. ui.manual_move.set_destination(xy); - ui.manual_move.soon(ALL_AXES_MASK); + ui.manual_move.soon(ALL_AXES_ENUM); } inline int32_t grid_index(const uint8_t x, const uint8_t y) { diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 69aed1e192..ec57b37a71 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -282,7 +282,7 @@ void report_current_position_projected() { void quickstop_stepper() { planner.quick_stop(); planner.synchronize(); - set_current_from_steppers_for_axis(ALL_AXES_MASK); + set_current_from_steppers_for_axis(ALL_AXES_ENUM); sync_plan_position(); } @@ -360,7 +360,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { planner.unapply_modifiers(pos, true); #endif - if (axis == ALL_AXES_MASK) + if (axis == ALL_AXES_ENUM) current_position = pos; else current_position[axis] = pos[axis];