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

@ -624,7 +624,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
#if EXTRA_PROBING
// Insert Z measurement into probes[]. Keep it sorted ascending.
for (uint8_t i = 0; i <= p; i++) { // Iterate the saved Zs to insert the new Z
LOOP_LE_N(i, p) { // Iterate the saved Zs to insert the new Z
if (i == p || probes[i] > z) { // Last index or new Z is smaller than this Z
for (int8_t m = p; --m >= i;) probes[m + 1] = probes[m]; // Shift items down after the insertion point
probes[i] = z; // Insert the new Z measurement
@ -662,7 +662,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
max_avg_idx--; else min_avg_idx++;
// Return the average value of all remaining probes.
for (uint8_t i = min_avg_idx; i <= max_avg_idx; i++)
LOOP_S_LE_N(i, min_avg_idx, max_avg_idx)
probes_z_sum += probes[i];
#endif