Преглед изворни кода

Log machine info in G28 and G29

Scott Lahteine пре 8 година
родитељ
комит
fd2269f489
1 измењених фајлова са 61 додато и 33 уклоњено
  1. 61
    33
      Marlin/Marlin_main.cpp

+ 61
- 33
Marlin/Marlin_main.cpp Прегледај датотеку

@@ -2902,6 +2902,61 @@ inline void gcode_G4() {
2902 2902
 
2903 2903
 #endif // QUICK_HOME
2904 2904
 
2905
+#if ENABLED(DEBUG_LEVELING_FEATURE)
2906
+
2907
+  void log_machine_info() {
2908
+    SERIAL_ECHOPGM("Machine Type: ");
2909
+    #if ENABLED(DELTA)
2910
+      SERIAL_ECHOLNPGM("Delta");
2911
+    #elif ENABLED(SCARA)
2912
+      SERIAL_ECHOLNPGM("SCARA");
2913
+    #elif ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
2914
+      SERIAL_ECHOLNPGM("Core");
2915
+    #else
2916
+      SERIAL_ECHOLNPGM("Cartesian");
2917
+    #endif
2918
+
2919
+    SERIAL_ECHOPGM("Probe: ");
2920
+    #if ENABLED(FIX_MOUNTED_PROBE)
2921
+      SERIAL_ECHOLNPGM("FIX_MOUNTED_PROBE");
2922
+    #elif HAS_Z_SERVO_ENDSTOP
2923
+      SERIAL_ECHOLNPGM("SERVO PROBE");
2924
+    #elif ENABLED(BLTOUCH)
2925
+      SERIAL_ECHOLNPGM("BLTOUCH");
2926
+    #elif ENABLED(Z_PROBE_SLED)
2927
+      SERIAL_ECHOLNPGM("Z_PROBE_SLED");
2928
+    #elif ENABLED(Z_PROBE_ALLEN_KEY)
2929
+      SERIAL_ECHOLNPGM("Z_PROBE_ALLEN_KEY");
2930
+    #else
2931
+      SERIAL_ECHOLNPGM("NONE");
2932
+    #endif
2933
+
2934
+    #if HAS_BED_PROBE
2935
+      SERIAL_ECHOPAIR("Probe Offset X:", X_PROBE_OFFSET_FROM_EXTRUDER);
2936
+      SERIAL_ECHOPAIR(" Y:", Y_PROBE_OFFSET_FROM_EXTRUDER);
2937
+      SERIAL_ECHOPAIR(" Z:", zprobe_zoffset);
2938
+      #if (X_PROBE_OFFSET_FROM_EXTRUDER > 0)
2939
+        SERIAL_ECHOPGM(" (Right");
2940
+      #elif (X_PROBE_OFFSET_FROM_EXTRUDER < 0)
2941
+        SERIAL_ECHOPGM(" (Left");
2942
+      #endif
2943
+      #if (Y_PROBE_OFFSET_FROM_EXTRUDER > 0)
2944
+        SERIAL_ECHOPGM("-Back");
2945
+      #elif (Y_PROBE_OFFSET_FROM_EXTRUDER < 0)
2946
+        SERIAL_ECHOPGM("-Front");
2947
+      #endif
2948
+      if (zprobe_zoffset < 0)
2949
+        SERIAL_ECHOPGM(" & Below");
2950
+      else if (zprobe_zoffset > 0)
2951
+        SERIAL_ECHOPGM(" & Above");
2952
+      else
2953
+        SERIAL_ECHOPGM(" & Same Z as");
2954
+      SERIAL_ECHOLNPGM(" Nozzle)");
2955
+    #endif
2956
+  }
2957
+
2958
+#endif // DEBUG_LEVELING_FEATURE
2959
+
2905 2960
 /**
2906 2961
  * G28: Home all axes according to settings
2907 2962
  *
@@ -2920,7 +2975,10 @@ inline void gcode_G4() {
2920 2975
 inline void gcode_G28() {
2921 2976
 
2922 2977
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2923
-    if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(">>> gcode_G28");
2978
+    if (DEBUGGING(LEVELING)) {
2979
+      SERIAL_ECHOLNPGM(">>> gcode_G28");
2980
+      log_machine_info();
2981
+    }
2924 2982
   #endif
2925 2983
 
2926 2984
   // Wait for planner moves to finish!
@@ -3267,6 +3325,7 @@ inline void gcode_G28() {
3267 3325
 #endif
3268 3326
 
3269 3327
 #if ENABLED(MESH_BED_LEVELING)
3328
+
3270 3329
   inline void _mbl_goto_xy(float x, float y) {
3271 3330
     float old_feedrate_mm_s = feedrate_mm_s;
3272 3331
     feedrate_mm_s = homing_feedrate_mm_s[X_AXIS];
@@ -3499,38 +3558,7 @@ inline void gcode_G28() {
3499 3558
       if (DEBUGGING(LEVELING)) {
3500 3559
         SERIAL_ECHOLNPGM(">>> gcode_G29");
3501 3560
         DEBUG_POS("", current_position);
3502
-        SERIAL_ECHOPGM("Probe: ");
3503
-        #if ENABLED(FIX_MOUNTED_PROBE)
3504
-          SERIAL_ECHOLNPGM("FIX_MOUNTED_PROBE");
3505
-        #elif HAS_Z_SERVO_ENDSTOP
3506
-          SERIAL_ECHOLNPGM("SERVO PROBE");
3507
-        #elif ENABLED(BLTOUCH)
3508
-          SERIAL_ECHOLNPGM("BLTOUCH");
3509
-        #elif ENABLED(Z_PROBE_SLED)
3510
-          SERIAL_ECHOLNPGM("Z_PROBE_SLED");
3511
-        #elif ENABLED(Z_PROBE_ALLEN_KEY)
3512
-          SERIAL_ECHOLNPGM("Z_PROBE_ALLEN_KEY");
3513
-        #endif
3514
-        SERIAL_ECHOPAIR("Probe Offset X:", X_PROBE_OFFSET_FROM_EXTRUDER);
3515
-        SERIAL_ECHOPAIR(" Y:", Y_PROBE_OFFSET_FROM_EXTRUDER);
3516
-        SERIAL_ECHOPAIR(" Z:", zprobe_zoffset);
3517
-        #if (X_PROBE_OFFSET_FROM_EXTRUDER > 0)
3518
-          SERIAL_ECHOPGM(" (Right");
3519
-        #elif (X_PROBE_OFFSET_FROM_EXTRUDER < 0)
3520
-          SERIAL_ECHOPGM(" (Left");
3521
-        #endif
3522
-        #if (Y_PROBE_OFFSET_FROM_EXTRUDER > 0)
3523
-          SERIAL_ECHOPGM("-Back");
3524
-        #elif (Y_PROBE_OFFSET_FROM_EXTRUDER < 0)
3525
-          SERIAL_ECHOPGM("-Front");
3526
-        #endif
3527
-        if (zprobe_zoffset < 0)
3528
-          SERIAL_ECHOPGM(" & Below");
3529
-        else if (zprobe_zoffset > 0)
3530
-          SERIAL_ECHOPGM(" & Above");
3531
-        else
3532
-          SERIAL_ECHOPGM(" & Same Z as");
3533
-        SERIAL_ECHOLNPGM(" Nozzle)");
3561
+        log_machine_info();
3534 3562
       }
3535 3563
     #endif
3536 3564
 

Loading…
Откажи
Сачувај