Przeglądaj źródła

Merge pull request #4286 from thinkyhead/rc_debug_clean

Prefix and suffix in debug output
Scott Lahteine 8 lat temu
rodzic
commit
4f77adddbe
1 zmienionych plików z 13 dodań i 11 usunięć
  1. 13
    11
      Marlin/Marlin_main.cpp

+ 13
- 11
Marlin/Marlin_main.cpp Wyświetl plik

@@ -573,22 +573,23 @@ void serial_echopair_P(const char* s_P, unsigned long v) { serialprintPGM(s_P);
573 573
 static void report_current_position();
574 574
 
575 575
 #if ENABLED(DEBUG_LEVELING_FEATURE)
576
-  void print_xyz(const char* suffix, const float x, const float y, const float z) {
576
+  void print_xyz(const char* prefix, const char* suffix, const float x, const float y, const float z) {
577
+    serialprintPGM(prefix);
577 578
     SERIAL_ECHOPAIR("(", x);
578 579
     SERIAL_ECHOPAIR(", ", y);
579 580
     SERIAL_ECHOPAIR(", ", z);
580
-    SERIAL_ECHOLNPGM(") ");
581
-    SERIAL_ECHO(suffix);
581
+    SERIAL_ECHOPGM(")");
582
+    serialprintPGM(suffix);
582 583
   }
583
-  void print_xyz(const char* suffix, const float xyz[]) {
584
-    print_xyz(suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]);
584
+  void print_xyz(const char* prefix,const char* suffix, const float xyz[]) {
585
+    print_xyz(prefix, suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]);
585 586
   }
586 587
   #if ENABLED(AUTO_BED_LEVELING_FEATURE)
587
-    void print_xyz(const char* suffix, const vector_3 &xyz) {
588
-      print_xyz(suffix, xyz.x, xyz.y, xyz.z);
588
+    void print_xyz(const char* prefix,const char* suffix, const vector_3 &xyz) {
589
+      print_xyz(prefix, suffix, xyz.x, xyz.y, xyz.z);
589 590
     }
590 591
   #endif
591
-  #define DEBUG_POS(PREFIX,VAR) do{ SERIAL_ECHOPGM(PREFIX); print_xyz(" > " STRINGIFY(VAR), VAR); }while(0)
592
+  #define DEBUG_POS(SUFFIX,VAR) do{ print_xyz(PSTR(STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); }while(0)
592 593
 #endif
593 594
 
594 595
 #if ENABLED(DELTA) || ENABLED(SCARA)
@@ -1540,6 +1541,7 @@ static void set_axis_is_at_home(AxisEnum axis) {
1540 1541
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1541 1542
       if (DEBUGGING(LEVELING)) {
1542 1543
         SERIAL_ECHOPAIR("> home_offset[axis]==", home_offset[axis]);
1544
+        SERIAL_EOL;
1543 1545
         DEBUG_POS("", current_position);
1544 1546
       }
1545 1547
     #endif
@@ -1653,7 +1655,7 @@ static void clean_up_after_endstop_or_probe_move() {
1653 1655
     float old_feedrate = feedrate;
1654 1656
 
1655 1657
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1656
-      if (DEBUGGING(LEVELING)) print_xyz("do_blocking_move_to", x, y, z);
1658
+      if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), "", x, y, z);
1657 1659
     #endif
1658 1660
 
1659 1661
     #if ENABLED(DELTA)
@@ -4327,7 +4329,7 @@ inline void gcode_M104() {
4327 4329
 
4328 4330
     #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
4329 4331
       /**
4330
-       * Stop the timer at the end of print, starting is managed by 
4332
+       * Stop the timer at the end of print, starting is managed by
4331 4333
        * 'heat and wait' M109.
4332 4334
        * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
4333 4335
        * stand by mode, for instance in a dual extruder setup, without affecting
@@ -4639,7 +4641,7 @@ inline void gcode_M109() {
4639 4641
       #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
4640 4642
         if (code_value_temp_abs() > BED_MINTEMP) {
4641 4643
           /**
4642
-          * We start the timer when 'heating and waiting' command arrives, LCD 
4644
+          * We start the timer when 'heating and waiting' command arrives, LCD
4643 4645
           * functions never wait. Cooling down managed by extruders.
4644 4646
           *
4645 4647
           * We do not check if the timer is already running because this check will

Ładowanie…
Anuluj
Zapisz