🎨 Planner indent

This commit is contained in:
Scott Lahteine 2023-12-21 22:34:19 -06:00
parent dbdb2ecdf7
commit 2c5468ce33

View file

@ -257,11 +257,15 @@ void Planner::init() {
position.reset(); position.reset();
TERN_(HAS_POSITION_FLOAT, position_float.reset()); TERN_(HAS_POSITION_FLOAT, position_float.reset());
TERN_(IS_KINEMATIC, position_cart.reset()); TERN_(IS_KINEMATIC, position_cart.reset());
previous_speed.reset(); previous_speed.reset();
previous_nominal_speed = 0; previous_nominal_speed = 0;
TERN_(ABL_PLANAR, bed_level_matrix.set_to_identity()); TERN_(ABL_PLANAR, bed_level_matrix.set_to_identity());
clear_block_buffer(); clear_block_buffer();
delay_before_delivering = 0; delay_before_delivering = 0;
#if ENABLED(DIRECT_STEPPING) #if ENABLED(DIRECT_STEPPING)
last_page_step_rate = 0; last_page_step_rate = 0;
last_page_dir.reset(); last_page_dir.reset();
@ -1970,23 +1974,21 @@ bool Planner::_populate_block(
dm.hy = (dist.b > 0); // ...and Y dm.hy = (dist.b > 0); // ...and Y
TERN_(HAS_Z_AXIS, dm.z = (dist.c > 0)); TERN_(HAS_Z_AXIS, dm.z = (dist.c > 0));
#endif #endif
#if IS_CORE #if CORE_IS_XY
#if CORE_IS_XY dm.a = (dist.a + dist.b > 0); // Motor A direction
dm.a = (dist.a + dist.b > 0); // Motor A direction dm.b = (CORESIGN(dist.a - dist.b) > 0); // Motor B direction
dm.b = (CORESIGN(dist.a - dist.b) > 0); // Motor B direction #elif CORE_IS_XZ
#elif CORE_IS_XZ dm.hx = (dist.a > 0); // Save the toolhead's true direction in X
dm.hx = (dist.a > 0); // Save the toolhead's true direction in X dm.y = (dist.b > 0);
dm.y = (dist.b > 0); dm.hz = (dist.c > 0); // ...and Z
dm.hz = (dist.c > 0); // ...and Z dm.a = (dist.a + dist.c > 0); // Motor A direction
dm.a = (dist.a + dist.c > 0); // Motor A direction dm.c = (CORESIGN(dist.a - dist.c) > 0); // Motor C direction
dm.c = (CORESIGN(dist.a - dist.c) > 0); // Motor C direction #elif CORE_IS_YZ
#elif CORE_IS_YZ dm.x = (dist.a > 0);
dm.x = (dist.a > 0); dm.hy = (dist.b > 0); // Save the toolhead's true direction in Y
dm.hy = (dist.b > 0); // Save the toolhead's true direction in Y dm.hz = (dist.c > 0); // ...and Z
dm.hz = (dist.c > 0); // ...and Z dm.b = (dist.b + dist.c > 0); // Motor B direction
dm.b = (dist.b + dist.c > 0); // Motor B direction dm.c = (CORESIGN(dist.b - dist.c) > 0); // Motor C direction
dm.c = (CORESIGN(dist.b - dist.c) > 0); // Motor C direction
#endif
#elif ENABLED(MARKFORGED_XY) #elif ENABLED(MARKFORGED_XY)
dm.a = (dist.a TERN(MARKFORGED_INVERSE, -, +) dist.b > 0); // Motor A direction dm.a = (dist.a TERN(MARKFORGED_INVERSE, -, +) dist.b > 0); // Motor A direction
dm.b = (dist.b > 0); // Motor B direction dm.b = (dist.b > 0); // Motor B direction
@ -2090,23 +2092,21 @@ bool Planner::_populate_block(
dist_mm.head.y = dist.b * mm_per_step[B_AXIS]; dist_mm.head.y = dist.b * mm_per_step[B_AXIS];
TERN_(HAS_Z_AXIS, dist_mm.z = dist.c * mm_per_step[Z_AXIS]); TERN_(HAS_Z_AXIS, dist_mm.z = dist.c * mm_per_step[Z_AXIS]);
#endif #endif
#if IS_CORE #if CORE_IS_XY
#if CORE_IS_XY dist_mm.a = (dist.a + dist.b) * mm_per_step[A_AXIS];
dist_mm.a = (dist.a + dist.b) * mm_per_step[A_AXIS]; dist_mm.b = CORESIGN(dist.a - dist.b) * mm_per_step[B_AXIS];
dist_mm.b = CORESIGN(dist.a - dist.b) * mm_per_step[B_AXIS]; #elif CORE_IS_XZ
#elif CORE_IS_XZ dist_mm.head.x = dist.a * mm_per_step[A_AXIS];
dist_mm.head.x = dist.a * mm_per_step[A_AXIS]; dist_mm.y = dist.b * mm_per_step[Y_AXIS];
dist_mm.y = dist.b * mm_per_step[Y_AXIS]; dist_mm.head.z = dist.c * mm_per_step[C_AXIS];
dist_mm.head.z = dist.c * mm_per_step[C_AXIS]; dist_mm.a = (dist.a + dist.c) * mm_per_step[A_AXIS];
dist_mm.a = (dist.a + dist.c) * mm_per_step[A_AXIS]; dist_mm.c = CORESIGN(dist.a - dist.c) * mm_per_step[C_AXIS];
dist_mm.c = CORESIGN(dist.a - dist.c) * mm_per_step[C_AXIS]; #elif CORE_IS_YZ
#elif CORE_IS_YZ dist_mm.x = dist.a * mm_per_step[X_AXIS];
dist_mm.x = dist.a * mm_per_step[X_AXIS]; dist_mm.head.y = dist.b * mm_per_step[B_AXIS];
dist_mm.head.y = dist.b * mm_per_step[B_AXIS]; dist_mm.head.z = dist.c * mm_per_step[C_AXIS];
dist_mm.head.z = dist.c * mm_per_step[C_AXIS]; dist_mm.b = (dist.b + dist.c) * mm_per_step[B_AXIS];
dist_mm.b = (dist.b + dist.c) * mm_per_step[B_AXIS]; dist_mm.c = CORESIGN(dist.b - dist.c) * mm_per_step[C_AXIS];
dist_mm.c = CORESIGN(dist.b - dist.c) * mm_per_step[C_AXIS];
#endif
#elif ENABLED(MARKFORGED_XY) #elif ENABLED(MARKFORGED_XY)
dist_mm.a = (dist.a TERN(MARKFORGED_INVERSE, +, -) dist.b) * mm_per_step[A_AXIS]; dist_mm.a = (dist.a TERN(MARKFORGED_INVERSE, +, -) dist.b) * mm_per_step[A_AXIS];
dist_mm.b = dist.b * mm_per_step[B_AXIS]; dist_mm.b = dist.b * mm_per_step[B_AXIS];
@ -2540,6 +2540,7 @@ bool Planner::_populate_block(
#if DISABLED(S_CURVE_ACCELERATION) #if DISABLED(S_CURVE_ACCELERATION)
block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / (STEPPER_TIMER_RATE))); block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / (STEPPER_TIMER_RATE)));
#endif #endif
#if ENABLED(LIN_ADVANCE) #if ENABLED(LIN_ADVANCE)
block->la_advance_rate = 0; block->la_advance_rate = 0;
block->la_scaling = 0; block->la_scaling = 0;