Apply loop shorthand macros (#17159)

This commit is contained in:
Scott Lahteine
2020-03-13 23:18:16 -05:00
committed by GitHub
parent a96be32fae
commit 118bd2f8b2
93 changed files with 465 additions and 505 deletions

View File

@ -54,7 +54,7 @@ Nozzle nozzle;
#endif
// Start the stroke pattern
for (uint8_t i = 0; i < (strokes >> 1); i++) {
LOOP_L_N(i, strokes >> 1) {
do_blocking_move_to_xy(end);
do_blocking_move_to_xy(start);
}
@ -91,7 +91,7 @@ Nozzle nozzle;
const bool horiz = ABS(diff.x) >= ABS(diff.y); // Do a horizontal wipe?
const float P = (horiz ? diff.x : diff.y) / zigs; // Period of each zig / zag
const xyz_pos_t *side;
for (uint8_t j = 0; j < strokes; j++) {
LOOP_L_N(j, strokes) {
for (int8_t i = 0; i < zigs; i++) {
side = (i & 1) ? &end : &start;
if (horiz)
@ -134,8 +134,8 @@ Nozzle nozzle;
do_blocking_move_to(start);
#endif
for (uint8_t s = 0; s < strokes; s++)
for (uint8_t i = 0; i < NOZZLE_CLEAN_CIRCLE_FN; i++)
LOOP_L_N(s, strokes)
LOOP_L_N(i, NOZZLE_CLEAN_CIRCLE_FN)
do_blocking_move_to_xy(
middle.x + sin((RADIANS(360) / NOZZLE_CLEAN_CIRCLE_FN) * i) * radius,
middle.y + cos((RADIANS(360) / NOZZLE_CLEAN_CIRCLE_FN) * i) * radius