|
@@ -565,14 +565,14 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
|
565
|
565
|
}
|
566
|
566
|
#endif
|
567
|
567
|
|
568
|
|
- #ifdef EXTRA_PROBING
|
|
568
|
+ #if EXTRA_PROBING > 0
|
569
|
569
|
float probes[TOTAL_PROBING];
|
570
|
570
|
#endif
|
571
|
571
|
|
572
|
572
|
#if TOTAL_PROBING > 2
|
573
|
573
|
float probes_z_sum = 0;
|
574
|
574
|
for (
|
575
|
|
- #if EXTRA_PROBING
|
|
575
|
+ #if EXTRA_PROBING > 0
|
576
|
576
|
uint8_t p = 0; p < TOTAL_PROBING; p++
|
577
|
577
|
#else
|
578
|
578
|
uint8_t p = TOTAL_PROBING; p--;
|
|
@@ -588,7 +588,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
|
588
|
588
|
|
589
|
589
|
const float z = current_position.z;
|
590
|
590
|
|
591
|
|
- #if EXTRA_PROBING
|
|
591
|
+ #if EXTRA_PROBING > 0
|
592
|
592
|
// Insert Z measurement into probes[]. Keep it sorted ascending.
|
593
|
593
|
LOOP_LE_N(i, p) { // Iterate the saved Zs to insert the new Z
|
594
|
594
|
if (i == p || probes[i] > z) { // Last index or new Z is smaller than this Z
|
|
@@ -605,14 +605,17 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
|
605
|
605
|
|
606
|
606
|
#if TOTAL_PROBING > 2
|
607
|
607
|
// Small Z raise after all but the last probe
|
608
|
|
- if (TERN(EXTRA_PROBING, p < TOTAL_PROBING - 1, p))
|
609
|
|
- do_blocking_move_to_z(z + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
|
|
608
|
+ if (p
|
|
609
|
+ #if EXTRA_PROBING > 0
|
|
610
|
+ < TOTAL_PROBING - 1
|
|
611
|
+ #endif
|
|
612
|
+ ) do_blocking_move_to_z(z + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
|
610
|
613
|
#endif
|
611
|
614
|
}
|
612
|
615
|
|
613
|
616
|
#if TOTAL_PROBING > 2
|
614
|
617
|
|
615
|
|
- #if EXTRA_PROBING
|
|
618
|
+ #if EXTRA_PROBING > 0
|
616
|
619
|
// Take the center value (or average the two middle values) as the median
|
617
|
620
|
static constexpr int PHALF = (TOTAL_PROBING - 1) / 2;
|
618
|
621
|
const float middle = probes[PHALF],
|