Browse Source

Merge pull request #4709 from thinkyhead/rc_log_the_reason

Log whether homing with probe or endstop
Scott Lahteine 8 years ago
parent
commit
8e9ac72191
1 changed files with 44 additions and 46 deletions
  1. 44
    46
      Marlin/Marlin_main.cpp

+ 44
- 46
Marlin/Marlin_main.cpp View File

1395
       SERIAL_ECHO_START;
1395
       SERIAL_ECHO_START;
1396
       SERIAL_CHAR('M');
1396
       SERIAL_CHAR('M');
1397
       SERIAL_ECHO(code);
1397
       SERIAL_ECHO(code);
1398
-      SERIAL_ECHOPAIR(" " MSG_INVALID_EXTRUDER " ", code_value_byte());
1399
-      SERIAL_EOL;
1398
+      SERIAL_ECHOLNPAIR(" " MSG_INVALID_EXTRUDER " ", code_value_byte());
1400
       return true;
1399
       return true;
1401
     }
1400
     }
1402
     target_extruder = code_value_byte();
1401
     target_extruder = code_value_byte();
1504
       SERIAL_ECHOPAIR(" axis:\n home_offset = ", home_offset[axis]);
1503
       SERIAL_ECHOPAIR(" axis:\n home_offset = ", home_offset[axis]);
1505
       SERIAL_ECHOPAIR("\n position_shift = ", position_shift[axis]);
1504
       SERIAL_ECHOPAIR("\n position_shift = ", position_shift[axis]);
1506
       SERIAL_ECHOPAIR("\n soft_endstop_min = ", soft_endstop_min[axis]);
1505
       SERIAL_ECHOPAIR("\n soft_endstop_min = ", soft_endstop_min[axis]);
1507
-      SERIAL_ECHOPAIR("\n soft_endstop_max = ", soft_endstop_max[axis]);
1508
-      SERIAL_EOL;
1506
+      SERIAL_ECHOLNPAIR("\n soft_endstop_max = ", soft_endstop_max[axis]);
1509
     }
1507
     }
1510
   #endif
1508
   #endif
1511
 
1509
 
1586
     current_position[axis] = LOGICAL_POSITION(base_home_pos(axis), axis);
1584
     current_position[axis] = LOGICAL_POSITION(base_home_pos(axis), axis);
1587
     update_software_endstops(axis);
1585
     update_software_endstops(axis);
1588
 
1586
 
1587
+    if (axis == Z_AXIS) {
1588
+      #if HAS_BED_PROBE && Z_HOME_DIR < 0
1589
+        #if DISABLED(Z_MIN_PROBE_ENDSTOP)
1590
+          current_position[Z_AXIS] -= zprobe_zoffset;
1591
+          #if ENABLED(DEBUG_LEVELING_FEATURE)
1592
+            if (DEBUGGING(LEVELING)) {
1593
+              SERIAL_ECHOLNPGM("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***");
1594
+              SERIAL_ECHOLNPAIR("> zprobe_zoffset = ", zprobe_zoffset);
1595
+            }
1596
+          #endif
1597
+        #elif ENABLED(DEBUG_LEVELING_FEATURE)
1598
+          if (DEBUGGING(LEVELING))
1599
+            SERIAL_ECHOLNPGM("*** Z HOMED TO ENDSTOP (Z_MIN_PROBE_ENDSTOP) ***");
1600
+        #endif
1601
+      #endif
1602
+    }
1603
+
1589
     #if HAS_BED_PROBE && Z_HOME_DIR < 0 && DISABLED(Z_MIN_PROBE_ENDSTOP)
1604
     #if HAS_BED_PROBE && Z_HOME_DIR < 0 && DISABLED(Z_MIN_PROBE_ENDSTOP)
1590
       if (axis == Z_AXIS) {
1605
       if (axis == Z_AXIS) {
1591
         current_position[Z_AXIS] -= zprobe_zoffset;
1606
         current_position[Z_AXIS] -= zprobe_zoffset;
1592
         #if ENABLED(DEBUG_LEVELING_FEATURE)
1607
         #if ENABLED(DEBUG_LEVELING_FEATURE)
1593
           if (DEBUGGING(LEVELING)) {
1608
           if (DEBUGGING(LEVELING)) {
1594
-            SERIAL_ECHOPAIR("> zprobe_zoffset = ", zprobe_zoffset);
1595
-            SERIAL_EOL;
1609
+            SERIAL_ECHOLNPGM("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***");
1610
+            SERIAL_ECHOLNPAIR("> zprobe_zoffset = ", zprobe_zoffset);
1596
           }
1611
           }
1597
         #endif
1612
         #endif
1598
       }
1613
       }
1614
+    #elif HAS_BED_PROBE && Z_HOME_DIR < 0 && ENABLED(DEBUG_LEVELING_FEATURE)
1615
+      if (DEBUGGING(LEVELING))
1616
+        SERIAL_ECHOLNPGM("*** Z HOMED TO ENDSTOP (Z_MIN_PROBE_ENDSTOP) ***");
1599
     #endif
1617
     #endif
1600
 
1618
 
1601
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1619
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1602
       if (DEBUGGING(LEVELING)) {
1620
       if (DEBUGGING(LEVELING)) {
1603
         SERIAL_ECHOPAIR("> home_offset[", axis_codes[axis]);
1621
         SERIAL_ECHOPAIR("> home_offset[", axis_codes[axis]);
1604
-        SERIAL_ECHOPAIR("] = ", home_offset[axis]);
1605
-        SERIAL_EOL;
1622
+        SERIAL_ECHOLNPAIR("] = ", home_offset[axis]);
1606
         DEBUG_POS("", current_position);
1623
         DEBUG_POS("", current_position);
1607
       }
1624
       }
1608
     #endif
1625
     #endif
2054
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2071
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2055
       if (DEBUGGING(LEVELING)) {
2072
       if (DEBUGGING(LEVELING)) {
2056
         DEBUG_POS("set_probe_deployed", current_position);
2073
         DEBUG_POS("set_probe_deployed", current_position);
2057
-        SERIAL_ECHOPAIR("deploy: ", deploy);
2058
-        SERIAL_EOL;
2074
+        SERIAL_ECHOLNPAIR("deploy: ", deploy);
2059
       }
2075
       }
2060
     #endif
2076
     #endif
2061
 
2077
 
3029
         if (destination[Z_AXIS] > current_position[Z_AXIS]) {
3045
         if (destination[Z_AXIS] > current_position[Z_AXIS]) {
3030
 
3046
 
3031
           #if ENABLED(DEBUG_LEVELING_FEATURE)
3047
           #if ENABLED(DEBUG_LEVELING_FEATURE)
3032
-            if (DEBUGGING(LEVELING)) {
3033
-              SERIAL_ECHOPAIR("Raise Z (before homing) to ", destination[Z_AXIS]);
3034
-              SERIAL_EOL;
3035
-            }
3048
+            if (DEBUGGING(LEVELING))
3049
+              SERIAL_ECHOLNPAIR("Raise Z (before homing) to ", destination[Z_AXIS]);
3036
           #endif
3050
           #endif
3037
 
3051
 
3038
           do_blocking_move_to_z(destination[Z_AXIS]);
3052
           do_blocking_move_to_z(destination[Z_AXIS]);
3842
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3856
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3843
           if (DEBUGGING(LEVELING)) {
3857
           if (DEBUGGING(LEVELING)) {
3844
             SERIAL_ECHOPAIR("> BEFORE apply_rotation_xyz > stepper_z = ", stepper_z);
3858
             SERIAL_ECHOPAIR("> BEFORE apply_rotation_xyz > stepper_z = ", stepper_z);
3845
-            SERIAL_ECHOPAIR(" ... z_tmp  = ", z_tmp);
3846
-            SERIAL_EOL;
3859
+            SERIAL_ECHOLNPAIR(" ... z_tmp  = ", z_tmp);
3847
           }
3860
           }
3848
         #endif
3861
         #endif
3849
 
3862
 
3851
         apply_rotation_xyz(planner.bed_level_matrix, x_tmp, y_tmp, z_tmp);
3864
         apply_rotation_xyz(planner.bed_level_matrix, x_tmp, y_tmp, z_tmp);
3852
 
3865
 
3853
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3866
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3854
-          if (DEBUGGING(LEVELING)) {
3855
-            SERIAL_ECHOPAIR("> AFTER apply_rotation_xyz > z_tmp  = ", z_tmp);
3856
-            SERIAL_EOL;
3857
-          }
3867
+          if (DEBUGGING(LEVELING))
3868
+            SERIAL_ECHOLNPAIR("> AFTER apply_rotation_xyz > z_tmp  = ", z_tmp);
3858
         #endif
3869
         #endif
3859
 
3870
 
3860
         // Adjust the current Z and send it to the planner.
3871
         // Adjust the current Z and send it to the planner.
4380
               Y_current /= 1.25;
4391
               Y_current /= 1.25;
4381
               if (verbose_level > 3) {
4392
               if (verbose_level > 3) {
4382
                 SERIAL_ECHOPAIR("Pulling point towards center:", X_current);
4393
                 SERIAL_ECHOPAIR("Pulling point towards center:", X_current);
4383
-                SERIAL_ECHOPAIR(", ", Y_current);
4384
-                SERIAL_EOL;
4394
+                SERIAL_ECHOLNPAIR(", ", Y_current);
4385
               }
4395
               }
4386
             }
4396
             }
4387
           #endif
4397
           #endif
4389
             SERIAL_PROTOCOLPGM("Going to:");
4399
             SERIAL_PROTOCOLPGM("Going to:");
4390
             SERIAL_ECHOPAIR(" X", X_current);
4400
             SERIAL_ECHOPAIR(" X", X_current);
4391
             SERIAL_ECHOPAIR(" Y", Y_current);
4401
             SERIAL_ECHOPAIR(" Y", Y_current);
4392
-            SERIAL_ECHOPAIR(" Z", current_position[Z_AXIS]);
4393
-            SERIAL_EOL;
4402
+            SERIAL_ECHOLNPAIR(" Z", current_position[Z_AXIS]);
4394
           }
4403
           }
4395
           do_blocking_move_to_xy(X_current, Y_current);
4404
           do_blocking_move_to_xy(X_current, Y_current);
4396
         } // n_legs loop
4405
         } // n_legs loop
4948
     }
4957
     }
4949
     else {
4958
     else {
4950
       SERIAL_ECHO_START;
4959
       SERIAL_ECHO_START;
4951
-      SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval);
4952
-      SERIAL_EOL;
4960
+      SERIAL_ECHOLNPAIR("M113 S", (unsigned long)host_keepalive_interval);
4953
     }
4961
     }
4954
   }
4962
   }
4955
 
4963
 
5399
 inline void gcode_M204() {
5407
 inline void gcode_M204() {
5400
   if (code_seen('S')) {  // Kept for legacy compatibility. Should NOT BE USED for new developments.
5408
   if (code_seen('S')) {  // Kept for legacy compatibility. Should NOT BE USED for new developments.
5401
     planner.travel_acceleration = planner.acceleration = code_value_linear_units();
5409
     planner.travel_acceleration = planner.acceleration = code_value_linear_units();
5402
-    SERIAL_ECHOPAIR("Setting Print and Travel Acceleration: ", planner.acceleration);
5403
-    SERIAL_EOL;
5410
+    SERIAL_ECHOLNPAIR("Setting Print and Travel Acceleration: ", planner.acceleration);
5404
   }
5411
   }
5405
   if (code_seen('P')) {
5412
   if (code_seen('P')) {
5406
     planner.acceleration = code_value_linear_units();
5413
     planner.acceleration = code_value_linear_units();
5407
-    SERIAL_ECHOPAIR("Setting Print Acceleration: ", planner.acceleration);
5408
-    SERIAL_EOL;
5414
+    SERIAL_ECHOLNPAIR("Setting Print Acceleration: ", planner.acceleration);
5409
   }
5415
   }
5410
   if (code_seen('R')) {
5416
   if (code_seen('R')) {
5411
     planner.retract_acceleration = code_value_linear_units();
5417
     planner.retract_acceleration = code_value_linear_units();
5412
-    SERIAL_ECHOPAIR("Setting Retract Acceleration: ", planner.retract_acceleration);
5413
-    SERIAL_EOL;
5418
+    SERIAL_ECHOLNPAIR("Setting Retract Acceleration: ", planner.retract_acceleration);
5414
   }
5419
   }
5415
   if (code_seen('T')) {
5420
   if (code_seen('T')) {
5416
     planner.travel_acceleration = code_value_linear_units();
5421
     planner.travel_acceleration = code_value_linear_units();
5417
-    SERIAL_ECHOPAIR("Setting Travel Acceleration: ", planner.travel_acceleration);
5418
-    SERIAL_EOL;
5422
+    SERIAL_ECHOLNPAIR("Setting Travel Acceleration: ", planner.travel_acceleration);
5419
   }
5423
   }
5420
 }
5424
 }
5421
 
5425
 
5491
           if (DEBUGGING(LEVELING)) {
5495
           if (DEBUGGING(LEVELING)) {
5492
             SERIAL_ECHOPGM("endstop_adj[");
5496
             SERIAL_ECHOPGM("endstop_adj[");
5493
             SERIAL_ECHO(axis_codes[i]);
5497
             SERIAL_ECHO(axis_codes[i]);
5494
-            SERIAL_ECHOPAIR("] = ", endstop_adj[i]);
5495
-            SERIAL_EOL;
5498
+            SERIAL_ECHOLNPAIR("] = ", endstop_adj[i]);
5496
           }
5499
           }
5497
         #endif
5500
         #endif
5498
       }
5501
       }
5511
    */
5514
    */
5512
   inline void gcode_M666() {
5515
   inline void gcode_M666() {
5513
     if (code_seen('Z')) z_endstop_adj = code_value_axis_units(Z_AXIS);
5516
     if (code_seen('Z')) z_endstop_adj = code_value_axis_units(Z_AXIS);
5514
-    SERIAL_ECHOPAIR("Z Endstop Adjustment set to (mm):", z_endstop_adj);
5515
-    SERIAL_EOL;
5517
+    SERIAL_ECHOLNPAIR("Z Endstop Adjustment set to (mm):", z_endstop_adj);
5516
   }
5518
   }
5517
 
5519
 
5518
 #endif // !DELTA && Z_DUAL_ENDSTOPS
5520
 #endif // !DELTA && Z_DUAL_ENDSTOPS
5587
   SERIAL_ECHOPGM("  " MSG_SOFT_MAX ": ");
5589
   SERIAL_ECHOPGM("  " MSG_SOFT_MAX ": ");
5588
   SERIAL_ECHOPAIR(    MSG_X, soft_endstop_max[X_AXIS]);
5590
   SERIAL_ECHOPAIR(    MSG_X, soft_endstop_max[X_AXIS]);
5589
   SERIAL_ECHOPAIR(" " MSG_Y, soft_endstop_max[Y_AXIS]);
5591
   SERIAL_ECHOPAIR(" " MSG_Y, soft_endstop_max[Y_AXIS]);
5590
-  SERIAL_ECHOPAIR(" " MSG_Z, soft_endstop_max[Z_AXIS]);
5591
-  SERIAL_EOL;
5592
+  SERIAL_ECHOLNPAIR(" " MSG_Z, soft_endstop_max[Z_AXIS]);
5592
 }
5593
 }
5593
 
5594
 
5594
 #if HOTENDS > 1
5595
 #if HOTENDS > 1
6822
 
6823
 
6823
           #if ENABLED(DEBUG_LEVELING_FEATURE)
6824
           #if ENABLED(DEBUG_LEVELING_FEATURE)
6824
             if (DEBUGGING(LEVELING)) {
6825
             if (DEBUGGING(LEVELING)) {
6825
-              SERIAL_ECHOPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no");
6826
-              SERIAL_EOL;
6826
+              SERIAL_ECHOLNPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no");
6827
               DEBUG_POS("New extruder (parked)", current_position);
6827
               DEBUG_POS("New extruder (parked)", current_position);
6828
             }
6828
             }
6829
           #endif
6829
           #endif
6932
                       ypos = RAW_CURRENT_POSITION(Y_AXIS);
6932
                       ypos = RAW_CURRENT_POSITION(Y_AXIS);
6933
                 current_position[Z_AXIS] += mbl.get_z(xpos + xydiff[X_AXIS], ypos + xydiff[Y_AXIS]) - mbl.get_z(xpos, ypos);
6933
                 current_position[Z_AXIS] += mbl.get_z(xpos + xydiff[X_AXIS], ypos + xydiff[Y_AXIS]) - mbl.get_z(xpos, ypos);
6934
                 #if ENABLED(DEBUG_LEVELING_FEATURE)
6934
                 #if ENABLED(DEBUG_LEVELING_FEATURE)
6935
-                  if (DEBUGGING(LEVELING)) {
6936
-                    SERIAL_ECHOPAIR(" after: ", current_position[Z_AXIS]);
6937
-                    SERIAL_EOL;
6938
-                  }
6935
+                  if (DEBUGGING(LEVELING))
6936
+                    SERIAL_ECHOLNPAIR(" after: ", current_position[Z_AXIS]);
6939
                 #endif
6937
                 #endif
6940
               }
6938
               }
6941
 
6939
 

Loading…
Cancel
Save