|
@@ -36,7 +36,7 @@
|
36
|
36
|
#include "../../../module/probe.h"
|
37
|
37
|
#include "../../queue.h"
|
38
|
38
|
|
39
|
|
-#if BOTH(LCD_BED_LEVELING, PROBE_MANUALLY)
|
|
39
|
+#if HAS_DISPLAY
|
40
|
40
|
#include "../../../lcd/ultralcd.h"
|
41
|
41
|
#endif
|
42
|
42
|
|
|
@@ -254,8 +254,8 @@ G29_TYPE GcodeSuite::G29() {
|
254
|
254
|
|
255
|
255
|
ABL_VAR int indexIntoAB[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
|
256
|
256
|
|
257
|
|
- ABL_VAR float eqnAMatrix[GRID_MAX_POINTS * 3], // "A" matrix of the linear system of equations
|
258
|
|
- eqnBVector[GRID_MAX_POINTS], // "B" vector of Z points
|
|
257
|
+ ABL_VAR float eqnAMatrix[(GRID_MAX_POINTS) * 3], // "A" matrix of the linear system of equations
|
|
258
|
+ eqnBVector[GRID_MAX_POINTS], // "B" vector of Z points
|
259
|
259
|
mean;
|
260
|
260
|
#endif
|
261
|
261
|
|
|
@@ -311,8 +311,7 @@ G29_TYPE GcodeSuite::G29() {
|
311
|
311
|
|
312
|
312
|
const float rx = RAW_X_POSITION(parser.linearval('X', NAN)),
|
313
|
313
|
ry = RAW_Y_POSITION(parser.linearval('Y', NAN));
|
314
|
|
- int8_t i = parser.byteval('I', -1),
|
315
|
|
- j = parser.byteval('J', -1);
|
|
314
|
+ int8_t i = parser.byteval('I', -1), j = parser.byteval('J', -1);
|
316
|
315
|
|
317
|
316
|
if (!isnan(rx) && !isnan(ry)) {
|
318
|
317
|
// Get nearest i / j from rx / ry
|
|
@@ -689,8 +688,11 @@ G29_TYPE GcodeSuite::G29() {
|
689
|
688
|
|
690
|
689
|
zig ^= true; // zag
|
691
|
690
|
|
|
691
|
+ // An index to print current state
|
|
692
|
+ uint8_t pt_index = (PR_OUTER_VAR) * (PR_INNER_END) + 1;
|
|
693
|
+
|
692
|
694
|
// Inner loop is Y with PROBE_Y_FIRST enabled
|
693
|
|
- for (int8_t PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; PR_INNER_VAR += inInc) {
|
|
695
|
+ for (int8_t PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; pt_index++, PR_INNER_VAR += inInc) {
|
694
|
696
|
|
695
|
697
|
const float xBase = left_probe_bed_position + xGridSpacing * xCount,
|
696
|
698
|
yBase = front_probe_bed_position + yGridSpacing * yCount;
|
|
@@ -707,11 +709,16 @@ G29_TYPE GcodeSuite::G29() {
|
707
|
709
|
if (!position_is_reachable_by_probe(xProbe, yProbe)) continue;
|
708
|
710
|
#endif
|
709
|
711
|
|
|
712
|
+ if (verbose_level) SERIAL_ECHOLNPAIR("Probing mesh point ", int(pt_index), "/", int(GRID_MAX_POINTS), ".");
|
|
713
|
+ #if HAS_DISPLAY
|
|
714
|
+ ui.status_printf_P(0, PSTR(MSG_PROBING_MESH " %i/%i"), int(pt_index), int(GRID_MAX_POINTS));
|
|
715
|
+ #endif
|
|
716
|
+
|
710
|
717
|
measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level);
|
711
|
718
|
|
712
|
719
|
if (isnan(measured_z)) {
|
713
|
720
|
set_bed_leveling_enabled(abl_should_enable);
|
714
|
|
- break;
|
|
721
|
+ break; // Breaks out of both loops
|
715
|
722
|
}
|
716
|
723
|
|
717
|
724
|
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
|
|
@@ -744,6 +751,11 @@ G29_TYPE GcodeSuite::G29() {
|
744
|
751
|
// Probe at 3 arbitrary points
|
745
|
752
|
|
746
|
753
|
for (uint8_t i = 0; i < 3; ++i) {
|
|
754
|
+ if (verbose_level) SERIAL_ECHOLNPAIR("Probing point ", int(i), "/3.");
|
|
755
|
+ #if HAS_DISPLAY
|
|
756
|
+ ui.status_printf_P(0, PSTR(MSG_PROBING_MESH " %i/3"), int(i));
|
|
757
|
+ #endif
|
|
758
|
+
|
747
|
759
|
// Retain the last probe position
|
748
|
760
|
xProbe = points[i].x;
|
749
|
761
|
yProbe = points[i].y;
|
|
@@ -770,6 +782,10 @@ G29_TYPE GcodeSuite::G29() {
|
770
|
782
|
|
771
|
783
|
#endif // AUTO_BED_LEVELING_3POINT
|
772
|
784
|
|
|
785
|
+ #if HAS_DISPLAY
|
|
786
|
+ ui.reset_status();
|
|
787
|
+ #endif
|
|
788
|
+
|
773
|
789
|
// Stow the probe. No raise for FIX_MOUNTED_PROBE.
|
774
|
790
|
if (STOW_PROBE()) {
|
775
|
791
|
set_bed_leveling_enabled(abl_should_enable);
|