Browse Source

Merge pull request #3400 from thinkyhead/rc_sensor_per_extruder

Add more leveling-debug output
Scott Lahteine 9 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
   void print_xyz(const char* prefix, const float xyz[]) {
1164
   void print_xyz(const char* prefix, const float xyz[]) {
1165
     print_xyz(prefix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]);
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
 #endif
1168
 #endif
1168
 
1169
 
1169
 static void set_axis_is_at_home(AxisEnum axis) {
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
   #if ENABLED(DUAL_X_CARRIAGE)
1178
   #if ENABLED(DUAL_X_CARRIAGE)
1172
     if (axis == X_AXIS) {
1179
     if (axis == X_AXIS) {
1234
     max_pos[axis] = base_max_pos(axis) + home_offset[axis];
1241
     max_pos[axis] = base_max_pos(axis) + home_offset[axis];
1235
 
1242
 
1236
     #if ENABLED(AUTO_BED_LEVELING_FEATURE) && Z_HOME_DIR < 0
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
     #endif
1250
     #endif
1239
 
1251
 
1240
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1252
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1241
       if (DEBUGGING(LEVELING)) {
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
     #endif
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
   feedrate_multiplier = 100;
1307
   feedrate_multiplier = 100;
1291
   refresh_cmd_timeout();
1308
   refresh_cmd_timeout();
1292
   #if ENABLED(DEBUG_LEVELING_FEATURE)
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
   #endif
1311
   #endif
1297
   enable_endstops(true);
1312
   enable_endstops(true);
1298
 }
1313
 }
1305
      */
1320
      */
1306
     void prepare_move_raw() {
1321
     void prepare_move_raw() {
1307
       #if ENABLED(DEBUG_LEVELING_FEATURE)
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
       #endif
1324
       #endif
1312
       refresh_cmd_timeout();
1325
       refresh_cmd_timeout();
1313
       calculate_delta(destination);
1326
       calculate_delta(destination);
1337
         current_position[Z_AXIS] = corrected_position.z;
1350
         current_position[Z_AXIS] = corrected_position.z;
1338
 
1351
 
1339
         #if ENABLED(DEBUG_LEVELING_FEATURE)
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
         #endif
1354
         #endif
1344
 
1355
 
1345
         sync_plan_position();
1356
         sync_plan_position();
1372
       current_position[Z_AXIS] = corrected_position.z;
1383
       current_position[Z_AXIS] = corrected_position.z;
1373
 
1384
 
1374
       #if ENABLED(DEBUG_LEVELING_FEATURE)
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
       #endif
1387
       #endif
1379
 
1388
 
1380
       sync_plan_position();
1389
       sync_plan_position();
1396
       long start_steps = st_get_position(Z_AXIS);
1405
       long start_steps = st_get_position(Z_AXIS);
1397
 
1406
 
1398
       #if ENABLED(DEBUG_LEVELING_FEATURE)
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
       #endif
1409
       #endif
1403
 
1410
 
1404
       // move down slowly until you find the bed
1411
       // move down slowly until you find the bed
1417
       current_position[Z_AXIS] = mm;
1424
       current_position[Z_AXIS] = mm;
1418
 
1425
 
1419
       #if ENABLED(DEBUG_LEVELING_FEATURE)
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
       #endif
1428
       #endif
1424
 
1429
 
1425
       sync_plan_position_delta();
1430
       sync_plan_position_delta();
1460
       sync_plan_position();
1465
       sync_plan_position();
1461
 
1466
 
1462
       #if ENABLED(DEBUG_LEVELING_FEATURE)
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
       #endif
1469
       #endif
1467
 
1470
 
1468
     #endif // !DELTA
1471
     #endif // !DELTA
1476
     float oldFeedRate = feedrate;
1479
     float oldFeedRate = feedrate;
1477
 
1480
 
1478
     #if ENABLED(DEBUG_LEVELING_FEATURE)
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
     #endif
1483
     #endif
1483
 
1484
 
1484
     #if ENABLED(DELTA)
1485
     #if ENABLED(DELTA)
1529
 
1530
 
1530
   static void clean_up_after_endstop_move() {
1531
   static void clean_up_after_endstop_move() {
1531
     #if ENABLED(DEBUG_LEVELING_FEATURE)
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
     #endif
1534
     #endif
1536
     endstops_not_homing();
1535
     endstops_not_homing();
1537
     feedrate = saved_feedrate;
1536
     feedrate = saved_feedrate;
1544
   static void deploy_z_probe() {
1543
   static void deploy_z_probe() {
1545
 
1544
 
1546
     #if ENABLED(DEBUG_LEVELING_FEATURE)
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
     #endif
1547
     #endif
1551
 
1548
 
1552
     if (z_probe_is_active) return;
1549
     if (z_probe_is_active) return;
1642
       UNUSED(doRaise);
1639
       UNUSED(doRaise);
1643
     #endif
1640
     #endif
1644
     #if ENABLED(DEBUG_LEVELING_FEATURE)
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
     #endif
1643
     #endif
1649
 
1644
 
1650
     if (!z_probe_is_active) return;
1645
     if (!z_probe_is_active) return;
1756
         SERIAL_ECHOLNPGM("probe_pt >>>");
1751
         SERIAL_ECHOLNPGM("probe_pt >>>");
1757
         SERIAL_ECHOPAIR("> ProbeAction:", (unsigned long)probe_action);
1752
         SERIAL_ECHOPAIR("> ProbeAction:", (unsigned long)probe_action);
1758
         SERIAL_EOL;
1753
         SERIAL_EOL;
1759
-        print_xyz("> current_position", current_position);
1754
+        DEBUG_POS("", current_position);
1760
       }
1755
       }
1761
     #endif
1756
     #endif
1762
 
1757
 
1786
     #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
1781
     #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
1787
       if (probe_action & ProbeDeploy) {
1782
       if (probe_action & ProbeDeploy) {
1788
         #if ENABLED(DEBUG_LEVELING_FEATURE)
1783
         #if ENABLED(DEBUG_LEVELING_FEATURE)
1789
-          if (DEBUGGING(LEVELING)) {
1790
-            SERIAL_ECHOLNPGM("> ProbeDeploy");
1791
-          }
1784
+          if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeDeploy");
1792
         #endif
1785
         #endif
1793
         deploy_z_probe();
1786
         deploy_z_probe();
1794
       }
1787
       }
1800
     #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
1793
     #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
1801
       if (probe_action & ProbeStow) {
1794
       if (probe_action & ProbeStow) {
1802
         #if ENABLED(DEBUG_LEVELING_FEATURE)
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
         #endif
1797
         #endif
1807
         stow_z_probe();
1798
         stow_z_probe();
1808
       }
1799
       }
1819
     }
1810
     }
1820
 
1811
 
1821
     #if ENABLED(DEBUG_LEVELING_FEATURE)
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
     #endif
1814
     #endif
1826
 
1815
 
1827
     return measured_z;
1816
     return measured_z;
1886
      */
1875
      */
1887
     void reset_bed_level() {
1876
     void reset_bed_level() {
1888
       #if ENABLED(DEBUG_LEVELING_FEATURE)
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
       #endif
1879
       #endif
1893
       for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) {
1880
       for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) {
1894
         for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) {
1881
         for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) {
1938
   static void dock_sled(bool dock, int offset = 0) {
1925
   static void dock_sled(bool dock, int offset = 0) {
1939
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1926
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1940
       if (DEBUGGING(LEVELING)) {
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
     #endif
1931
     #endif
1945
 
1932
 
1984
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1971
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1985
     if (DEBUGGING(LEVELING)) {
1972
     if (DEBUGGING(LEVELING)) {
1986
       SERIAL_ECHOPAIR(">>> homeaxis(", (unsigned long)axis);
1973
       SERIAL_ECHOPAIR(">>> homeaxis(", (unsigned long)axis);
1987
-      SERIAL_CHAR(')');
1988
-      SERIAL_EOL;
1974
+      SERIAL_ECHOLNPGM(")");
1989
     }
1975
     }
1990
   #endif
1976
   #endif
1991
   #define HOMEAXIS_DO(LETTER) \
1977
   #define HOMEAXIS_DO(LETTER) \
2050
     sync_plan_position();
2036
     sync_plan_position();
2051
 
2037
 
2052
     #if ENABLED(DEBUG_LEVELING_FEATURE)
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
     #endif
2040
     #endif
2057
     enable_endstops(false); // Disable endstops while moving away
2041
     enable_endstops(false); // Disable endstops while moving away
2058
 
2042
 
2062
     st_synchronize();
2046
     st_synchronize();
2063
 
2047
 
2064
     #if ENABLED(DEBUG_LEVELING_FEATURE)
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
     #endif
2050
     #endif
2069
     enable_endstops(true); // Enable endstops for next homing move
2051
     enable_endstops(true); // Enable endstops for next homing move
2070
 
2052
 
2077
     st_synchronize();
2059
     st_synchronize();
2078
 
2060
 
2079
     #if ENABLED(DEBUG_LEVELING_FEATURE)
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
     #endif
2063
     #endif
2084
 
2064
 
2085
     #if ENABLED(Z_DUAL_ENDSTOPS)
2065
     #if ENABLED(Z_DUAL_ENDSTOPS)
2111
       // retrace by the amount specified in endstop_adj
2091
       // retrace by the amount specified in endstop_adj
2112
       if (endstop_adj[axis] * axis_home_dir < 0) {
2092
       if (endstop_adj[axis] * axis_home_dir < 0) {
2113
         #if ENABLED(DEBUG_LEVELING_FEATURE)
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
         #endif
2095
         #endif
2118
         enable_endstops(false); // Disable endstops while moving away
2096
         enable_endstops(false); // Disable endstops while moving away
2119
         sync_plan_position();
2097
         sync_plan_position();
2121
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2099
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2122
           if (DEBUGGING(LEVELING)) {
2100
           if (DEBUGGING(LEVELING)) {
2123
             SERIAL_ECHOPAIR("> endstop_adj = ", endstop_adj[axis]);
2101
             SERIAL_ECHOPAIR("> endstop_adj = ", endstop_adj[axis]);
2124
-            print_xyz(" > destination", destination);
2102
+            DEBUG_POS("", destination);
2125
           }
2103
           }
2126
         #endif
2104
         #endif
2127
         line_to_destination();
2105
         line_to_destination();
2128
         st_synchronize();
2106
         st_synchronize();
2129
         #if ENABLED(DEBUG_LEVELING_FEATURE)
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
         #endif
2109
         #endif
2134
         enable_endstops(true); // Enable endstops for next homing move
2110
         enable_endstops(true); // Enable endstops for next homing move
2135
       }
2111
       }
2148
     sync_plan_position();
2124
     sync_plan_position();
2149
 
2125
 
2150
     #if ENABLED(DEBUG_LEVELING_FEATURE)
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
     #endif
2128
     #endif
2155
 
2129
 
2156
     destination[axis] = current_position[axis];
2130
     destination[axis] = current_position[axis];
2163
     #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE)
2137
     #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE)
2164
       if (axis == Z_AXIS && axis_home_dir < 0) {
2138
       if (axis == Z_AXIS && axis_home_dir < 0) {
2165
         #if ENABLED(DEBUG_LEVELING_FEATURE)
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
         #endif
2141
         #endif
2170
         _Z_STOW;
2142
         _Z_STOW;
2171
       }
2143
       }
2175
     #if HAS_SERVO_ENDSTOPS
2147
     #if HAS_SERVO_ENDSTOPS
2176
       if (_Z_SERVO_TEST && servo_endstop_id[axis] >= 0) {
2148
       if (_Z_SERVO_TEST && servo_endstop_id[axis] >= 0) {
2177
         #if ENABLED(DEBUG_LEVELING_FEATURE)
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
         #endif
2151
         #endif
2182
         servo[servo_endstop_id[axis]].move(servo_endstop_angle[axis][1]);
2152
         servo[servo_endstop_id[axis]].move(servo_endstop_angle[axis][1]);
2183
         if (_Z_PROBE_SUBTEST) z_probe_is_active = false;
2153
         if (_Z_PROBE_SUBTEST) z_probe_is_active = false;
2189
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2159
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2190
     if (DEBUGGING(LEVELING)) {
2160
     if (DEBUGGING(LEVELING)) {
2191
       SERIAL_ECHOPAIR("<<< homeaxis(", (unsigned long)axis);
2161
       SERIAL_ECHOPAIR("<<< homeaxis(", (unsigned long)axis);
2192
-      SERIAL_CHAR(')');
2193
-      SERIAL_EOL;
2162
+      SERIAL_ECHOLNPGM(")");
2194
     }
2163
     }
2195
   #endif
2164
   #endif
2196
 }
2165
 }
2428
 inline void gcode_G28() {
2397
 inline void gcode_G28() {
2429
 
2398
 
2430
   #if ENABLED(DEBUG_LEVELING_FEATURE)
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
   #endif
2401
   #endif
2435
 
2402
 
2436
   // Wait for planner moves to finish!
2403
   // Wait for planner moves to finish!
2491
     sync_plan_position_delta();
2458
     sync_plan_position_delta();
2492
 
2459
 
2493
     #if ENABLED(DEBUG_LEVELING_FEATURE)
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
     #endif
2462
     #endif
2498
 
2463
 
2499
   #else // NOT DELTA
2464
   #else // NOT DELTA
2509
       if (home_all_axis || homeZ) {
2474
       if (home_all_axis || homeZ) {
2510
         HOMEAXIS(Z);
2475
         HOMEAXIS(Z);
2511
         #if ENABLED(DEBUG_LEVELING_FEATURE)
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
         #endif
2478
         #endif
2516
       }
2479
       }
2517
 
2480
 
2525
           if (DEBUGGING(LEVELING)) {
2488
           if (DEBUGGING(LEVELING)) {
2526
             SERIAL_ECHOPAIR("Raise Z (before homing) to ", (float)(MIN_Z_HEIGHT_FOR_HOMING));
2489
             SERIAL_ECHOPAIR("Raise Z (before homing) to ", (float)(MIN_Z_HEIGHT_FOR_HOMING));
2527
             SERIAL_EOL;
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
         #endif
2494
         #endif
2532
         line_to_destination();
2495
         line_to_destination();
2570
         sync_plan_position();
2533
         sync_plan_position();
2571
 
2534
 
2572
         #if ENABLED(DEBUG_LEVELING_FEATURE)
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
         #endif
2537
         #endif
2577
 
2538
 
2578
         destination[X_AXIS] = current_position[X_AXIS];
2539
         destination[X_AXIS] = current_position[X_AXIS];
2589
         #endif
2550
         #endif
2590
 
2551
 
2591
         #if ENABLED(DEBUG_LEVELING_FEATURE)
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
         #endif
2554
         #endif
2596
       }
2555
       }
2597
 
2556
 
2620
         HOMEAXIS(X);
2579
         HOMEAXIS(X);
2621
       #endif
2580
       #endif
2622
       #if ENABLED(DEBUG_LEVELING_FEATURE)
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
       #endif
2583
       #endif
2627
     }
2584
     }
2628
 
2585
 
2631
       if (home_all_axis || homeY) {
2588
       if (home_all_axis || homeY) {
2632
         HOMEAXIS(Y);
2589
         HOMEAXIS(Y);
2633
         #if ENABLED(DEBUG_LEVELING_FEATURE)
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
         #endif
2592
         #endif
2638
       }
2593
       }
2639
     #endif
2594
     #endif
2672
 
2627
 
2673
             #if ENABLED(DEBUG_LEVELING_FEATURE)
2628
             #if ENABLED(DEBUG_LEVELING_FEATURE)
2674
               if (DEBUGGING(LEVELING)) {
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
             #endif
2633
             #endif
2679
 
2634
 
2736
         #endif // !Z_SAFE_HOMING
2691
         #endif // !Z_SAFE_HOMING
2737
 
2692
 
2738
         #if ENABLED(DEBUG_LEVELING_FEATURE)
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
         #endif
2695
         #endif
2743
 
2696
 
2744
       } // home_all_axis || homeZ
2697
       } // home_all_axis || homeZ
2754
   #endif
2707
   #endif
2755
 
2708
 
2756
   #if ENABLED(ENDSTOPS_ONLY_FOR_HOMING)
2709
   #if ENABLED(ENDSTOPS_ONLY_FOR_HOMING)
2710
+    enable_endstops(false);
2757
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2711
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2758
       if (DEBUGGING(LEVELING)) {
2712
       if (DEBUGGING(LEVELING)) {
2759
         SERIAL_ECHOLNPGM("ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)");
2713
         SERIAL_ECHOLNPGM("ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)");
2760
       }
2714
       }
2761
     #endif
2715
     #endif
2762
-    enable_endstops(false);
2763
   #endif
2716
   #endif
2764
 
2717
 
2765
   // For mesh leveling move back to Z=0
2718
   // For mesh leveling move back to Z=0
2774
       line_to_destination();
2727
       line_to_destination();
2775
       st_synchronize();
2728
       st_synchronize();
2776
       #if ENABLED(DEBUG_LEVELING_FEATURE)
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
       #endif
2731
       #endif
2781
     }
2732
     }
2782
   #endif
2733
   #endif
2999
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2950
     #if ENABLED(DEBUG_LEVELING_FEATURE)
3000
       if (DEBUGGING(LEVELING)) {
2951
       if (DEBUGGING(LEVELING)) {
3001
         SERIAL_ECHOLNPGM("gcode_G29 >>>");
2952
         SERIAL_ECHOLNPGM("gcode_G29 >>>");
2953
+        DEBUG_POS("", current_position);
3002
       }
2954
       }
3003
     #endif
2955
     #endif
3004
 
2956
 
3217
       } //yProbe
3169
       } //yProbe
3218
 
3170
 
3219
       #if ENABLED(DEBUG_LEVELING_FEATURE)
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
       #endif
3173
       #endif
3224
 
3174
 
3225
       clean_up_after_endstop_move();
3175
       clean_up_after_endstop_move();
3416
         sync_plan_position();
3366
         sync_plan_position();
3417
 
3367
 
3418
         #if ENABLED(DEBUG_LEVELING_FEATURE)
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
         #endif
3370
         #endif
3423
       }
3371
       }
3424
 
3372
 

Loading…
Cancel
Save