🎨 Fix comments, formatting

This commit is contained in:
Scott Lahteine 2022-06-20 21:15:57 -05:00 committed by Scott Lahteine
parent 6f51f19257
commit bf084254da
3 changed files with 12 additions and 19 deletions

View file

@ -489,13 +489,10 @@ void MarlinUI::init() {
ui.manual_move.menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; ui.manual_move.menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
ui.encoderPosition = dir; ui.encoderPosition = dir;
switch (axis) { switch (axis) {
case X_AXIS: { void lcd_move_x(); lcd_move_x(); } break; case X_AXIS:
#if HAS_Y_AXIS TERN_(HAS_Y_AXIS, case Y_AXIS:)
case Y_AXIS: { void lcd_move_y(); lcd_move_y(); } break; TERN_(HAS_Z_AXIS, case Z_AXIS:)
#endif lcd_move_axis(axis);
#if HAS_Z_AXIS
case Z_AXIS: { void lcd_move_z(); lcd_move_z(); } break;
#endif
default: break; default: break;
} }
} }

View file

@ -2073,9 +2073,9 @@ bool Planner::_populate_block(
TERN_(HAS_K_AXIS, steps_dist_mm.k = dk * mm_per_step[K_AXIS]); TERN_(HAS_K_AXIS, steps_dist_mm.k = dk * mm_per_step[K_AXIS]);
#elif ENABLED(MARKFORGED_XY) #elif ENABLED(MARKFORGED_XY)
steps_dist_mm.a = (da - db) * mm_per_step[A_AXIS]; 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) #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]; steps_dist_mm.b = (db - da) * mm_per_step[B_AXIS];
#else #else
XYZ_CODE( XYZ_CODE(
@ -2134,16 +2134,16 @@ bool Planner::_populate_block(
sq(steps_dist_mm.x) + sq(steps_dist_mm.y) sq(steps_dist_mm.x) + sq(steps_dist_mm.y)
#endif #endif
#else #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 #endif
); );
} }
/** /**
* At this point at least one of the axes has more steps than * 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 * MIN_STEPS_PER_SEGMENT, ensuring the segment won't get dropped
* zero-length. It's important to not apply corrections * as zero-length. It's important to not apply corrections to blocks
* to blocks that would get dropped! * that would get dropped!
* *
* A correction function is permitted to add steps to an axis, it * A correction function is permitted to add steps to an axis, it
* should *never* remove steps! * should *never* remove steps!

View file

@ -942,9 +942,7 @@ void reset_trinamic_drivers() {
struct SanityHwSerialDetails { const char port[20]; uint32_t address; }; 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_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) } #define TMC_HW_DETAIL(A) { TMC_HW_DETAIL_ARGS(A) }
constexpr SanityHwSerialDetails sanity_tmc_hw_details[] = { constexpr SanityHwSerialDetails sanity_tmc_hw_details[] = { MAPLIST(TMC_HW_DETAIL, ALL_AXIS_NAMES) };
MAPLIST(TMC_HW_DETAIL, ALL_AXIS_NAMES)
};
// constexpr compatible string comparison // constexpr compatible string comparison
constexpr bool str_eq_ce(const char * a, const char * b) { 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; }; 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_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) } #define TMC_SW_DETAIL(A) { TMC_SW_DETAIL_ARGS(A) }
constexpr SanitySwSerialDetails sanity_tmc_sw_details[] = { constexpr SanitySwSerialDetails sanity_tmc_sw_details[] = { MAPLIST(TMC_SW_DETAIL, ALL_AXIS_NAMES) };
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_done(size_t start, size_t end) { return start == end; }
constexpr bool sc_sw_skip(int32_t txpin) { return txpin < 0; } constexpr bool sc_sw_skip(int32_t txpin) { return txpin < 0; }