From cd9a23c4d0b4b7e4a2a8d9dd020cdc787300102e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Jun 2022 21:15:57 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Fix=20comments,=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/marlinui.cpp | 11 ++++------- Marlin/src/module/planner.cpp | 12 ++++++------ Marlin/src/module/stepper/trinamic.cpp | 8 ++------ 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 741cd4ee29..7d9cb1b679 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -489,13 +489,10 @@ void MarlinUI::init() { ui.manual_move.menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; ui.encoderPosition = dir; switch (axis) { - case X_AXIS: { void lcd_move_x(); lcd_move_x(); } break; - #if HAS_Y_AXIS - case Y_AXIS: { void lcd_move_y(); lcd_move_y(); } break; - #endif - #if HAS_Z_AXIS - case Z_AXIS: { void lcd_move_z(); lcd_move_z(); } break; - #endif + case X_AXIS: + TERN_(HAS_Y_AXIS, case Y_AXIS:) + TERN_(HAS_Z_AXIS, case Z_AXIS:) + lcd_move_axis(axis); default: break; } } diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index d5ee51f00b..f2c0ccffd5 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2073,9 +2073,9 @@ bool Planner::_populate_block( TERN_(HAS_K_AXIS, steps_dist_mm.k = dk * mm_per_step[K_AXIS]); #elif ENABLED(MARKFORGED_XY) steps_dist_mm.a = (da - db) * mm_per_step[A_AXIS]; - steps_dist_mm.b = db * mm_per_step[B_AXIS]; + steps_dist_mm.b = db * mm_per_step[B_AXIS]; #elif ENABLED(MARKFORGED_YX) - steps_dist_mm.a = da * mm_per_step[A_AXIS]; + steps_dist_mm.a = da * mm_per_step[A_AXIS]; steps_dist_mm.b = (db - da) * mm_per_step[B_AXIS]; #else XYZ_CODE( @@ -2134,16 +2134,16 @@ bool Planner::_populate_block( sq(steps_dist_mm.x) + sq(steps_dist_mm.y) #endif #else - XYZ_GANG(sq(steps_dist_mm.x), + sq(steps_dist_mm.y), + sq(steps_dist_mm.z)) + XYZ_GANG(sq(steps_dist_mm.x), + sq(steps_dist_mm.y), + sq(steps_dist_mm.z)) #endif ); } /** * At this point at least one of the axes has more steps than - * MIN_STEPS_PER_SEGMENT, ensuring the segment won't get dropped as - * zero-length. It's important to not apply corrections - * to blocks that would get dropped! + * MIN_STEPS_PER_SEGMENT, ensuring the segment won't get dropped + * as zero-length. It's important to not apply corrections to blocks + * that would get dropped! * * A correction function is permitted to add steps to an axis, it * should *never* remove steps! diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp index 9811f09603..383c02fd60 100644 --- a/Marlin/src/module/stepper/trinamic.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -942,9 +942,7 @@ void reset_trinamic_drivers() { struct SanityHwSerialDetails { const char port[20]; uint32_t address; }; #define TMC_HW_DETAIL_ARGS(A) TERN(A##_HAS_HW_SERIAL, STRINGIFY(A##_HARDWARE_SERIAL), ""), TERN0(A##_HAS_HW_SERIAL, A##_SLAVE_ADDRESS) #define TMC_HW_DETAIL(A) { TMC_HW_DETAIL_ARGS(A) } - constexpr SanityHwSerialDetails sanity_tmc_hw_details[] = { - MAPLIST(TMC_HW_DETAIL, ALL_AXIS_NAMES) - }; + constexpr SanityHwSerialDetails sanity_tmc_hw_details[] = { MAPLIST(TMC_HW_DETAIL, ALL_AXIS_NAMES) }; // constexpr compatible string comparison constexpr bool str_eq_ce(const char * a, const char * b) { @@ -969,9 +967,7 @@ void reset_trinamic_drivers() { struct SanitySwSerialDetails { int32_t txpin; int32_t rxpin; uint32_t address; }; #define TMC_SW_DETAIL_ARGS(A) TERN(A##_HAS_SW_SERIAL, A##_SERIAL_TX_PIN, -1), TERN(A##_HAS_SW_SERIAL, A##_SERIAL_RX_PIN, -1), TERN0(A##_HAS_SW_SERIAL, A##_SLAVE_ADDRESS) #define TMC_SW_DETAIL(A) { TMC_SW_DETAIL_ARGS(A) } - constexpr SanitySwSerialDetails sanity_tmc_sw_details[] = { - MAPLIST(TMC_SW_DETAIL, ALL_AXIS_NAMES) - }; + constexpr SanitySwSerialDetails sanity_tmc_sw_details[] = { MAPLIST(TMC_SW_DETAIL, ALL_AXIS_NAMES) }; constexpr bool sc_sw_done(size_t start, size_t end) { return start == end; } constexpr bool sc_sw_skip(int32_t txpin) { return txpin < 0; }