Skip to content

Commit 2c5468c

Browse files
committed
🎨 Planner indent
1 parent dbdb2ec commit 2c5468c

File tree

1 file changed

+35
-34
lines changed

1 file changed

+35
-34
lines changed

Marlin/src/module/planner.cpp

+35-34
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,15 @@ void Planner::init() {
257257
position.reset();
258258
TERN_(HAS_POSITION_FLOAT, position_float.reset());
259259
TERN_(IS_KINEMATIC, position_cart.reset());
260+
260261
previous_speed.reset();
261262
previous_nominal_speed = 0;
263+
262264
TERN_(ABL_PLANAR, bed_level_matrix.set_to_identity());
265+
263266
clear_block_buffer();
264267
delay_before_delivering = 0;
268+
265269
#if ENABLED(DIRECT_STEPPING)
266270
last_page_step_rate = 0;
267271
last_page_dir.reset();
@@ -1970,23 +1974,21 @@ bool Planner::_populate_block(
19701974
dm.hy = (dist.b > 0); // ...and Y
19711975
TERN_(HAS_Z_AXIS, dm.z = (dist.c > 0));
19721976
#endif
1973-
#if IS_CORE
1974-
#if CORE_IS_XY
1975-
dm.a = (dist.a + dist.b > 0); // Motor A direction
1976-
dm.b = (CORESIGN(dist.a - dist.b) > 0); // Motor B direction
1977-
#elif CORE_IS_XZ
1978-
dm.hx = (dist.a > 0); // Save the toolhead's true direction in X
1979-
dm.y = (dist.b > 0);
1980-
dm.hz = (dist.c > 0); // ...and Z
1981-
dm.a = (dist.a + dist.c > 0); // Motor A direction
1982-
dm.c = (CORESIGN(dist.a - dist.c) > 0); // Motor C direction
1983-
#elif CORE_IS_YZ
1984-
dm.x = (dist.a > 0);
1985-
dm.hy = (dist.b > 0); // Save the toolhead's true direction in Y
1986-
dm.hz = (dist.c > 0); // ...and Z
1987-
dm.b = (dist.b + dist.c > 0); // Motor B direction
1988-
dm.c = (CORESIGN(dist.b - dist.c) > 0); // Motor C direction
1989-
#endif
1977+
#if CORE_IS_XY
1978+
dm.a = (dist.a + dist.b > 0); // Motor A direction
1979+
dm.b = (CORESIGN(dist.a - dist.b) > 0); // Motor B direction
1980+
#elif CORE_IS_XZ
1981+
dm.hx = (dist.a > 0); // Save the toolhead's true direction in X
1982+
dm.y = (dist.b > 0);
1983+
dm.hz = (dist.c > 0); // ...and Z
1984+
dm.a = (dist.a + dist.c > 0); // Motor A direction
1985+
dm.c = (CORESIGN(dist.a - dist.c) > 0); // Motor C direction
1986+
#elif CORE_IS_YZ
1987+
dm.x = (dist.a > 0);
1988+
dm.hy = (dist.b > 0); // Save the toolhead's true direction in Y
1989+
dm.hz = (dist.c > 0); // ...and Z
1990+
dm.b = (dist.b + dist.c > 0); // Motor B direction
1991+
dm.c = (CORESIGN(dist.b - dist.c) > 0); // Motor C direction
19901992
#elif ENABLED(MARKFORGED_XY)
19911993
dm.a = (dist.a TERN(MARKFORGED_INVERSE, -, +) dist.b > 0); // Motor A direction
19921994
dm.b = (dist.b > 0); // Motor B direction
@@ -2090,23 +2092,21 @@ bool Planner::_populate_block(
20902092
dist_mm.head.y = dist.b * mm_per_step[B_AXIS];
20912093
TERN_(HAS_Z_AXIS, dist_mm.z = dist.c * mm_per_step[Z_AXIS]);
20922094
#endif
2093-
#if IS_CORE
2094-
#if CORE_IS_XY
2095-
dist_mm.a = (dist.a + dist.b) * mm_per_step[A_AXIS];
2096-
dist_mm.b = CORESIGN(dist.a - dist.b) * mm_per_step[B_AXIS];
2097-
#elif CORE_IS_XZ
2098-
dist_mm.head.x = dist.a * mm_per_step[A_AXIS];
2099-
dist_mm.y = dist.b * mm_per_step[Y_AXIS];
2100-
dist_mm.head.z = dist.c * mm_per_step[C_AXIS];
2101-
dist_mm.a = (dist.a + dist.c) * mm_per_step[A_AXIS];
2102-
dist_mm.c = CORESIGN(dist.a - dist.c) * mm_per_step[C_AXIS];
2103-
#elif CORE_IS_YZ
2104-
dist_mm.x = dist.a * mm_per_step[X_AXIS];
2105-
dist_mm.head.y = dist.b * mm_per_step[B_AXIS];
2106-
dist_mm.head.z = dist.c * mm_per_step[C_AXIS];
2107-
dist_mm.b = (dist.b + dist.c) * mm_per_step[B_AXIS];
2108-
dist_mm.c = CORESIGN(dist.b - dist.c) * mm_per_step[C_AXIS];
2109-
#endif
2095+
#if CORE_IS_XY
2096+
dist_mm.a = (dist.a + dist.b) * mm_per_step[A_AXIS];
2097+
dist_mm.b = CORESIGN(dist.a - dist.b) * mm_per_step[B_AXIS];
2098+
#elif CORE_IS_XZ
2099+
dist_mm.head.x = dist.a * mm_per_step[A_AXIS];
2100+
dist_mm.y = dist.b * mm_per_step[Y_AXIS];
2101+
dist_mm.head.z = dist.c * mm_per_step[C_AXIS];
2102+
dist_mm.a = (dist.a + dist.c) * mm_per_step[A_AXIS];
2103+
dist_mm.c = CORESIGN(dist.a - dist.c) * mm_per_step[C_AXIS];
2104+
#elif CORE_IS_YZ
2105+
dist_mm.x = dist.a * mm_per_step[X_AXIS];
2106+
dist_mm.head.y = dist.b * mm_per_step[B_AXIS];
2107+
dist_mm.head.z = dist.c * mm_per_step[C_AXIS];
2108+
dist_mm.b = (dist.b + dist.c) * mm_per_step[B_AXIS];
2109+
dist_mm.c = CORESIGN(dist.b - dist.c) * mm_per_step[C_AXIS];
21102110
#elif ENABLED(MARKFORGED_XY)
21112111
dist_mm.a = (dist.a TERN(MARKFORGED_INVERSE, +, -) dist.b) * mm_per_step[A_AXIS];
21122112
dist_mm.b = dist.b * mm_per_step[B_AXIS];
@@ -2540,6 +2540,7 @@ bool Planner::_populate_block(
25402540
#if DISABLED(S_CURVE_ACCELERATION)
25412541
block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / (STEPPER_TIMER_RATE)));
25422542
#endif
2543+
25432544
#if ENABLED(LIN_ADVANCE)
25442545
block->la_advance_rate = 0;
25452546
block->la_scaling = 0;

0 commit comments

Comments
 (0)