Browse Source

Merge pull request #3400 from thinkyhead/rc_sensor_per_extruder

Add more leveling-debug output
Scott Lahteine 8 years ago
parent
commit
2988147880
1 changed files with 67 additions and 119 deletions
  1. 67
    119
      Marlin/Marlin_main.cpp

+ 67
- 119
Marlin/Marlin_main.cpp View File

@@ -1164,9 +1164,16 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
1164 1164
   void print_xyz(const char* prefix, const float xyz[]) {
1165 1165
     print_xyz(prefix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]);
1166 1166
   }
1167
+  #define DEBUG_POS(PREFIX,VAR) do{ SERIAL_ECHOPGM(PREFIX); print_xyz(" > " STRINGIFY(VAR), VAR); }while(0)
1167 1168
 #endif
1168 1169
 
1169 1170
 static void set_axis_is_at_home(AxisEnum axis) {
1171
+  #if ENABLED(DEBUG_LEVELING_FEATURE)
1172
+    if (DEBUGGING(LEVELING)) {
1173
+      SERIAL_ECHOPAIR("set_axis_is_at_home(", (unsigned long)axis);
1174
+      SERIAL_ECHOLNPGM(") >>>");
1175
+    }
1176
+  #endif
1170 1177
 
1171 1178
   #if ENABLED(DUAL_X_CARRIAGE)
1172 1179
     if (axis == X_AXIS) {
@@ -1234,17 +1241,27 @@ static void set_axis_is_at_home(AxisEnum axis) {
1234 1241
     max_pos[axis] = base_max_pos(axis) + home_offset[axis];
1235 1242
 
1236 1243
     #if ENABLED(AUTO_BED_LEVELING_FEATURE) && Z_HOME_DIR < 0
1237
-      if (axis == Z_AXIS) current_position[Z_AXIS] -= zprobe_zoffset;
1244
+      if (axis == Z_AXIS) {
1245
+        current_position[Z_AXIS] -= zprobe_zoffset;
1246
+        #if ENABLED(DEBUG_LEVELING_FEATURE)
1247
+          if (DEBUGGING(LEVELING)) SERIAL_ECHOPAIR("> zprobe_zoffset==", zprobe_zoffset);
1248
+        #endif
1249
+      }
1238 1250
     #endif
1239 1251
 
1240 1252
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1241 1253
       if (DEBUGGING(LEVELING)) {
1242
-        SERIAL_ECHOPAIR("set_axis_is_at_home ", (unsigned long)axis);
1243
-        SERIAL_ECHOPAIR(" > (home_offset[axis]==", home_offset[axis]);
1244
-        print_xyz(") > current_position", current_position);
1254
+        SERIAL_ECHOPAIR("> home_offset[axis]==", home_offset[axis]);
1255
+        DEBUG_POS("", current_position);
1245 1256
       }
1246 1257
     #endif
1247 1258
   }
1259
+  #if ENABLED(DEBUG_LEVELING_FEATURE)
1260
+    if (DEBUGGING(LEVELING)) {
1261
+      SERIAL_ECHOPAIR("<<< set_axis_is_at_home(", (unsigned long)axis);
1262
+      SERIAL_ECHOLNPGM(")");
1263
+    }
1264
+  #endif
1248 1265
 }
1249 1266
 
1250 1267
 /**
@@ -1290,9 +1307,7 @@ static void setup_for_endstop_move() {
1290 1307
   feedrate_multiplier = 100;
1291 1308
   refresh_cmd_timeout();
1292 1309
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1293
-    if (DEBUGGING(LEVELING)) {
1294
-      SERIAL_ECHOLNPGM("setup_for_endstop_move > enable_endstops(true)");
1295
-    }
1310
+    if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("setup_for_endstop_move > enable_endstops(true)");
1296 1311
   #endif
1297 1312
   enable_endstops(true);
1298 1313
 }
@@ -1305,9 +1320,7 @@ static void setup_for_endstop_move() {
1305 1320
      */
1306 1321
     void prepare_move_raw() {
1307 1322
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1308
-        if (DEBUGGING(LEVELING)) {
1309
-          print_xyz("prepare_move_raw > destination", destination);
1310
-        }
1323
+        if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_move_raw", destination);
1311 1324
       #endif
1312 1325
       refresh_cmd_timeout();
1313 1326
       calculate_delta(destination);
@@ -1337,9 +1350,7 @@ static void setup_for_endstop_move() {
1337 1350
         current_position[Z_AXIS] = corrected_position.z;
1338 1351
 
1339 1352
         #if ENABLED(DEBUG_LEVELING_FEATURE)
1340
-          if (DEBUGGING(LEVELING)) {
1341
-            print_xyz("set_bed_level_equation_lsq > current_position", current_position);
1342
-          }
1353
+          if (DEBUGGING(LEVELING)) DEBUG_POS("set_bed_level_equation_lsq", current_position);
1343 1354
         #endif
1344 1355
 
1345 1356
         sync_plan_position();
@@ -1372,9 +1383,7 @@ static void setup_for_endstop_move() {
1372 1383
       current_position[Z_AXIS] = corrected_position.z;
1373 1384
 
1374 1385
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1375
-        if (DEBUGGING(LEVELING)) {
1376
-          print_xyz("set_bed_level_equation_3pts > current_position", current_position);
1377
-        }
1386
+        if (DEBUGGING(LEVELING)) DEBUG_POS("set_bed_level_equation_3pts", current_position);
1378 1387
       #endif
1379 1388
 
1380 1389
       sync_plan_position();
@@ -1396,9 +1405,7 @@ static void setup_for_endstop_move() {
1396 1405
       long start_steps = st_get_position(Z_AXIS);
1397 1406
 
1398 1407
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1399
-        if (DEBUGGING(LEVELING)) {
1400
-          SERIAL_ECHOLNPGM("run_z_probe (DELTA) 1");
1401
-        }
1408
+        if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("run_z_probe (DELTA) 1");
1402 1409
       #endif
1403 1410
 
1404 1411
       // move down slowly until you find the bed
@@ -1417,9 +1424,7 @@ static void setup_for_endstop_move() {
1417 1424
       current_position[Z_AXIS] = mm;
1418 1425
 
1419 1426
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1420
-        if (DEBUGGING(LEVELING)) {
1421
-          print_xyz("run_z_probe (DELTA) 2 > current_position", current_position);
1422
-        }
1427
+        if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe (DELTA) 2", current_position);
1423 1428
       #endif
1424 1429
 
1425 1430
       sync_plan_position_delta();
@@ -1460,9 +1465,7 @@ static void setup_for_endstop_move() {
1460 1465
       sync_plan_position();
1461 1466
 
1462 1467
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1463
-        if (DEBUGGING(LEVELING)) {
1464
-          print_xyz("run_z_probe > current_position", current_position);
1465
-        }
1468
+        if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe", current_position);
1466 1469
       #endif
1467 1470
 
1468 1471
     #endif // !DELTA
@@ -1476,9 +1479,7 @@ static void setup_for_endstop_move() {
1476 1479
     float oldFeedRate = feedrate;
1477 1480
 
1478 1481
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1479
-      if (DEBUGGING(LEVELING)) {
1480
-        print_xyz("do_blocking_move_to", x, y, z);
1481
-      }
1482
+      if (DEBUGGING(LEVELING)) print_xyz("do_blocking_move_to", x, y, z);
1482 1483
     #endif
1483 1484
 
1484 1485
     #if ENABLED(DELTA)
@@ -1529,9 +1530,7 @@ static void setup_for_endstop_move() {
1529 1530
 
1530 1531
   static void clean_up_after_endstop_move() {
1531 1532
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1532
-      if (DEBUGGING(LEVELING)) {
1533
-        SERIAL_ECHOLNPGM("clean_up_after_endstop_move > ENDSTOPS_ONLY_FOR_HOMING > endstops_not_homing()");
1534
-      }
1533
+      if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("clean_up_after_endstop_move > ENDSTOPS_ONLY_FOR_HOMING > endstops_not_homing()");
1535 1534
     #endif
1536 1535
     endstops_not_homing();
1537 1536
     feedrate = saved_feedrate;
@@ -1544,9 +1543,7 @@ static void setup_for_endstop_move() {
1544 1543
   static void deploy_z_probe() {
1545 1544
 
1546 1545
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1547
-      if (DEBUGGING(LEVELING)) {
1548
-        print_xyz("deploy_z_probe > current_position", current_position);
1549
-      }
1546
+      if (DEBUGGING(LEVELING)) DEBUG_POS("deploy_z_probe", current_position);
1550 1547
     #endif
1551 1548
 
1552 1549
     if (z_probe_is_active) return;
@@ -1642,9 +1639,7 @@ static void setup_for_endstop_move() {
1642 1639
       UNUSED(doRaise);
1643 1640
     #endif
1644 1641
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1645
-      if (DEBUGGING(LEVELING)) {
1646
-        print_xyz("stow_z_probe > current_position", current_position);
1647
-      }
1642
+      if (DEBUGGING(LEVELING)) DEBUG_POS("stow_z_probe", current_position);
1648 1643
     #endif
1649 1644
 
1650 1645
     if (!z_probe_is_active) return;
@@ -1756,7 +1751,7 @@ static void setup_for_endstop_move() {
1756 1751
         SERIAL_ECHOLNPGM("probe_pt >>>");
1757 1752
         SERIAL_ECHOPAIR("> ProbeAction:", (unsigned long)probe_action);
1758 1753
         SERIAL_EOL;
1759
-        print_xyz("> current_position", current_position);
1754
+        DEBUG_POS("", current_position);
1760 1755
       }
1761 1756
     #endif
1762 1757
 
@@ -1786,9 +1781,7 @@ static void setup_for_endstop_move() {
1786 1781
     #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
1787 1782
       if (probe_action & ProbeDeploy) {
1788 1783
         #if ENABLED(DEBUG_LEVELING_FEATURE)
1789
-          if (DEBUGGING(LEVELING)) {
1790
-            SERIAL_ECHOLNPGM("> ProbeDeploy");
1791
-          }
1784
+          if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeDeploy");
1792 1785
         #endif
1793 1786
         deploy_z_probe();
1794 1787
       }
@@ -1800,9 +1793,7 @@ static void setup_for_endstop_move() {
1800 1793
     #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
1801 1794
       if (probe_action & ProbeStow) {
1802 1795
         #if ENABLED(DEBUG_LEVELING_FEATURE)
1803
-          if (DEBUGGING(LEVELING)) {
1804
-            SERIAL_ECHOLNPGM("> ProbeStow (stow_z_probe will do Z Raise)");
1805
-          }
1796
+          if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeStow (stow_z_probe will do Z Raise)");
1806 1797
         #endif
1807 1798
         stow_z_probe();
1808 1799
       }
@@ -1819,9 +1810,7 @@ static void setup_for_endstop_move() {
1819 1810
     }
1820 1811
 
1821 1812
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1822
-      if (DEBUGGING(LEVELING)) {
1823
-        SERIAL_ECHOLNPGM("<<< probe_pt");
1824
-      }
1813
+      if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< probe_pt");
1825 1814
     #endif
1826 1815
 
1827 1816
     return measured_z;
@@ -1886,9 +1875,7 @@ static void setup_for_endstop_move() {
1886 1875
      */
1887 1876
     void reset_bed_level() {
1888 1877
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1889
-        if (DEBUGGING(LEVELING)) {
1890
-          SERIAL_ECHOLNPGM("reset_bed_level");
1891
-        }
1878
+        if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("reset_bed_level");
1892 1879
       #endif
1893 1880
       for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) {
1894 1881
         for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) {
@@ -1938,8 +1925,8 @@ static void setup_for_endstop_move() {
1938 1925
   static void dock_sled(bool dock, int offset = 0) {
1939 1926
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1940 1927
       if (DEBUGGING(LEVELING)) {
1941
-        SERIAL_ECHOPAIR("dock_sled", dock);
1942
-        SERIAL_EOL;
1928
+        SERIAL_ECHOPAIR("dock_sled(", dock);
1929
+        SERIAL_ECHOLNPGM(")");
1943 1930
       }
1944 1931
     #endif
1945 1932
 
@@ -1984,8 +1971,7 @@ static void homeaxis(AxisEnum axis) {
1984 1971
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1985 1972
     if (DEBUGGING(LEVELING)) {
1986 1973
       SERIAL_ECHOPAIR(">>> homeaxis(", (unsigned long)axis);
1987
-      SERIAL_CHAR(')');
1988
-      SERIAL_EOL;
1974
+      SERIAL_ECHOLNPGM(")");
1989 1975
     }
1990 1976
   #endif
1991 1977
   #define HOMEAXIS_DO(LETTER) \
@@ -2050,9 +2036,7 @@ static void homeaxis(AxisEnum axis) {
2050 2036
     sync_plan_position();
2051 2037
 
2052 2038
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2053
-      if (DEBUGGING(LEVELING)) {
2054
-        SERIAL_ECHOLNPGM("> enable_endstops(false)");
2055
-      }
2039
+      if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> enable_endstops(false)");
2056 2040
     #endif
2057 2041
     enable_endstops(false); // Disable endstops while moving away
2058 2042
 
@@ -2062,9 +2046,7 @@ static void homeaxis(AxisEnum axis) {
2062 2046
     st_synchronize();
2063 2047
 
2064 2048
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2065
-      if (DEBUGGING(LEVELING)) {
2066
-        SERIAL_ECHOLNPGM("> enable_endstops(true)");
2067
-      }
2049
+      if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> enable_endstops(true)");
2068 2050
     #endif
2069 2051
     enable_endstops(true); // Enable endstops for next homing move
2070 2052
 
@@ -2077,9 +2059,7 @@ static void homeaxis(AxisEnum axis) {
2077 2059
     st_synchronize();
2078 2060
 
2079 2061
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2080
-      if (DEBUGGING(LEVELING)) {
2081
-        print_xyz("> TRIGGER ENDSTOP > current_position", current_position);
2082
-      }
2062
+      if (DEBUGGING(LEVELING)) DEBUG_POS("> TRIGGER ENDSTOP", current_position);
2083 2063
     #endif
2084 2064
 
2085 2065
     #if ENABLED(Z_DUAL_ENDSTOPS)
@@ -2111,9 +2091,7 @@ static void homeaxis(AxisEnum axis) {
2111 2091
       // retrace by the amount specified in endstop_adj
2112 2092
       if (endstop_adj[axis] * axis_home_dir < 0) {
2113 2093
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2114
-          if (DEBUGGING(LEVELING)) {
2115
-            SERIAL_ECHOLNPGM("> enable_endstops(false)");
2116
-          }
2094
+          if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> enable_endstops(false)");
2117 2095
         #endif
2118 2096
         enable_endstops(false); // Disable endstops while moving away
2119 2097
         sync_plan_position();
@@ -2121,15 +2099,13 @@ static void homeaxis(AxisEnum axis) {
2121 2099
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2122 2100
           if (DEBUGGING(LEVELING)) {
2123 2101
             SERIAL_ECHOPAIR("> endstop_adj = ", endstop_adj[axis]);
2124
-            print_xyz(" > destination", destination);
2102
+            DEBUG_POS("", destination);
2125 2103
           }
2126 2104
         #endif
2127 2105
         line_to_destination();
2128 2106
         st_synchronize();
2129 2107
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2130
-          if (DEBUGGING(LEVELING)) {
2131
-            SERIAL_ECHOLNPGM("> enable_endstops(true)");
2132
-          }
2108
+          if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> enable_endstops(true)");
2133 2109
         #endif
2134 2110
         enable_endstops(true); // Enable endstops for next homing move
2135 2111
       }
@@ -2148,9 +2124,7 @@ static void homeaxis(AxisEnum axis) {
2148 2124
     sync_plan_position();
2149 2125
 
2150 2126
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2151
-      if (DEBUGGING(LEVELING)) {
2152
-        print_xyz("> AFTER set_axis_is_at_home > current_position", current_position);
2153
-      }
2127
+      if (DEBUGGING(LEVELING)) DEBUG_POS("> AFTER set_axis_is_at_home", current_position);
2154 2128
     #endif
2155 2129
 
2156 2130
     destination[axis] = current_position[axis];
@@ -2163,9 +2137,7 @@ static void homeaxis(AxisEnum axis) {
2163 2137
     #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE)
2164 2138
       if (axis == Z_AXIS && axis_home_dir < 0) {
2165 2139
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2166
-          if (DEBUGGING(LEVELING)) {
2167
-            SERIAL_ECHOLNPGM("> SERVO_LEVELING > " STRINGIFY(_Z_STOW));
2168
-          }
2140
+          if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_LEVELING > " STRINGIFY(_Z_STOW));
2169 2141
         #endif
2170 2142
         _Z_STOW;
2171 2143
       }
@@ -2175,9 +2147,7 @@ static void homeaxis(AxisEnum axis) {
2175 2147
     #if HAS_SERVO_ENDSTOPS
2176 2148
       if (_Z_SERVO_TEST && servo_endstop_id[axis] >= 0) {
2177 2149
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2178
-          if (DEBUGGING(LEVELING)) {
2179
-            SERIAL_ECHOLNPGM("> SERVO_ENDSTOPS > Stow with servo.move()");
2180
-          }
2150
+          if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_ENDSTOPS > Stow with servo.move()");
2181 2151
         #endif
2182 2152
         servo[servo_endstop_id[axis]].move(servo_endstop_angle[axis][1]);
2183 2153
         if (_Z_PROBE_SUBTEST) z_probe_is_active = false;
@@ -2189,8 +2159,7 @@ static void homeaxis(AxisEnum axis) {
2189 2159
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2190 2160
     if (DEBUGGING(LEVELING)) {
2191 2161
       SERIAL_ECHOPAIR("<<< homeaxis(", (unsigned long)axis);
2192
-      SERIAL_CHAR(')');
2193
-      SERIAL_EOL;
2162
+      SERIAL_ECHOLNPGM(")");
2194 2163
     }
2195 2164
   #endif
2196 2165
 }
@@ -2428,9 +2397,7 @@ inline void gcode_G4() {
2428 2397
 inline void gcode_G28() {
2429 2398
 
2430 2399
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2431
-    if (DEBUGGING(LEVELING)) {
2432
-      SERIAL_ECHOLNPGM("gcode_G28 >>>");
2433
-    }
2400
+    if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("gcode_G28 >>>");
2434 2401
   #endif
2435 2402
 
2436 2403
   // Wait for planner moves to finish!
@@ -2491,9 +2458,7 @@ inline void gcode_G28() {
2491 2458
     sync_plan_position_delta();
2492 2459
 
2493 2460
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2494
-      if (DEBUGGING(LEVELING)) {
2495
-        print_xyz("(DELTA) > current_position", current_position);
2496
-      }
2461
+      if (DEBUGGING(LEVELING)) DEBUG_POS("(DELTA)", current_position);
2497 2462
     #endif
2498 2463
 
2499 2464
   #else // NOT DELTA
@@ -2509,9 +2474,7 @@ inline void gcode_G28() {
2509 2474
       if (home_all_axis || homeZ) {
2510 2475
         HOMEAXIS(Z);
2511 2476
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2512
-          if (DEBUGGING(LEVELING)) {
2513
-            print_xyz("> HOMEAXIS(Z) > current_position", current_position);
2514
-          }
2477
+          if (DEBUGGING(LEVELING)) DEBUG_POS("> HOMEAXIS(Z)", current_position);
2515 2478
         #endif
2516 2479
       }
2517 2480
 
@@ -2525,8 +2488,8 @@ inline void gcode_G28() {
2525 2488
           if (DEBUGGING(LEVELING)) {
2526 2489
             SERIAL_ECHOPAIR("Raise Z (before homing) to ", (float)(MIN_Z_HEIGHT_FOR_HOMING));
2527 2490
             SERIAL_EOL;
2528
-            print_xyz("> (home_all_axis || homeZ) > current_position", current_position);
2529
-            print_xyz("> (home_all_axis || homeZ) > destination", destination);
2491
+            DEBUG_POS("> (home_all_axis || homeZ)", current_position);
2492
+            DEBUG_POS("> (home_all_axis || homeZ)", destination);
2530 2493
           }
2531 2494
         #endif
2532 2495
         line_to_destination();
@@ -2570,9 +2533,7 @@ inline void gcode_G28() {
2570 2533
         sync_plan_position();
2571 2534
 
2572 2535
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2573
-          if (DEBUGGING(LEVELING)) {
2574
-            print_xyz("> QUICK_HOME > current_position 1", current_position);
2575
-          }
2536
+          if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 1", current_position);
2576 2537
         #endif
2577 2538
 
2578 2539
         destination[X_AXIS] = current_position[X_AXIS];
@@ -2589,9 +2550,7 @@ inline void gcode_G28() {
2589 2550
         #endif
2590 2551
 
2591 2552
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2592
-          if (DEBUGGING(LEVELING)) {
2593
-            print_xyz("> QUICK_HOME > current_position 2", current_position);
2594
-          }
2553
+          if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 2", current_position);
2595 2554
         #endif
2596 2555
       }
2597 2556
 
@@ -2620,9 +2579,7 @@ inline void gcode_G28() {
2620 2579
         HOMEAXIS(X);
2621 2580
       #endif
2622 2581
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2623
-        if (DEBUGGING(LEVELING)) {
2624
-          print_xyz("> homeX", current_position);
2625
-        }
2582
+        if (DEBUGGING(LEVELING)) DEBUG_POS("> homeX", current_position);
2626 2583
       #endif
2627 2584
     }
2628 2585
 
@@ -2631,9 +2588,7 @@ inline void gcode_G28() {
2631 2588
       if (home_all_axis || homeY) {
2632 2589
         HOMEAXIS(Y);
2633 2590
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2634
-          if (DEBUGGING(LEVELING)) {
2635
-            print_xyz("> homeY", current_position);
2636
-          }
2591
+          if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position);
2637 2592
         #endif
2638 2593
       }
2639 2594
     #endif
@@ -2672,8 +2627,8 @@ inline void gcode_G28() {
2672 2627
 
2673 2628
             #if ENABLED(DEBUG_LEVELING_FEATURE)
2674 2629
               if (DEBUGGING(LEVELING)) {
2675
-                print_xyz("> Z_SAFE_HOMING > home_all_axis > current_position", current_position);
2676
-                print_xyz("> Z_SAFE_HOMING > home_all_axis > destination", destination);
2630
+                DEBUG_POS("> Z_SAFE_HOMING > home_all_axis", current_position);
2631
+                DEBUG_POS("> Z_SAFE_HOMING > home_all_axis", destination);
2677 2632
               }
2678 2633
             #endif
2679 2634
 
@@ -2736,9 +2691,7 @@ inline void gcode_G28() {
2736 2691
         #endif // !Z_SAFE_HOMING
2737 2692
 
2738 2693
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2739
-          if (DEBUGGING(LEVELING)) {
2740
-            print_xyz("> (home_all_axis || homeZ) > final", current_position);
2741
-          }
2694
+          if (DEBUGGING(LEVELING)) DEBUG_POS("> (home_all_axis || homeZ) > final", current_position);
2742 2695
         #endif
2743 2696
 
2744 2697
       } // home_all_axis || homeZ
@@ -2754,12 +2707,12 @@ inline void gcode_G28() {
2754 2707
   #endif
2755 2708
 
2756 2709
   #if ENABLED(ENDSTOPS_ONLY_FOR_HOMING)
2710
+    enable_endstops(false);
2757 2711
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2758 2712
       if (DEBUGGING(LEVELING)) {
2759 2713
         SERIAL_ECHOLNPGM("ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)");
2760 2714
       }
2761 2715
     #endif
2762
-    enable_endstops(false);
2763 2716
   #endif
2764 2717
 
2765 2718
   // For mesh leveling move back to Z=0
@@ -2774,9 +2727,7 @@ inline void gcode_G28() {
2774 2727
       line_to_destination();
2775 2728
       st_synchronize();
2776 2729
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2777
-        if (DEBUGGING(LEVELING)) {
2778
-          print_xyz("mbl_was_active > current_position", current_position);
2779
-        }
2730
+        if (DEBUGGING(LEVELING)) DEBUG_POS("mbl_was_active", current_position);
2780 2731
       #endif
2781 2732
     }
2782 2733
   #endif
@@ -2999,6 +2950,7 @@ inline void gcode_G28() {
2999 2950
     #if ENABLED(DEBUG_LEVELING_FEATURE)
3000 2951
       if (DEBUGGING(LEVELING)) {
3001 2952
         SERIAL_ECHOLNPGM("gcode_G29 >>>");
2953
+        DEBUG_POS("", current_position);
3002 2954
       }
3003 2955
     #endif
3004 2956
 
@@ -3217,9 +3169,7 @@ inline void gcode_G28() {
3217 3169
       } //yProbe
3218 3170
 
3219 3171
       #if ENABLED(DEBUG_LEVELING_FEATURE)
3220
-        if (DEBUGGING(LEVELING)) {
3221
-          print_xyz("> probing complete > current_position", current_position);
3222
-        }
3172
+        if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position);
3223 3173
       #endif
3224 3174
 
3225 3175
       clean_up_after_endstop_move();
@@ -3416,9 +3366,7 @@ inline void gcode_G28() {
3416 3366
         sync_plan_position();
3417 3367
 
3418 3368
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3419
-          if (DEBUGGING(LEVELING)) {
3420
-            print_xyz("> corrected Z in G29", current_position);
3421
-          }
3369
+          if (DEBUGGING(LEVELING)) DEBUG_POS("> corrected Z in G29", current_position);
3422 3370
         #endif
3423 3371
       }
3424 3372
 

Loading…
Cancel
Save