Browse Source

Merge pull request #4286 from thinkyhead/rc_debug_clean

Prefix and suffix in debug output
Scott Lahteine 8 years ago
parent
commit
4f77adddbe
1 changed files with 13 additions and 11 deletions
  1. 13
    11
      Marlin/Marlin_main.cpp

+ 13
- 11
Marlin/Marlin_main.cpp View File

573
 static void report_current_position();
573
 static void report_current_position();
574
 
574
 
575
 #if ENABLED(DEBUG_LEVELING_FEATURE)
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
     SERIAL_ECHOPAIR("(", x);
578
     SERIAL_ECHOPAIR("(", x);
578
     SERIAL_ECHOPAIR(", ", y);
579
     SERIAL_ECHOPAIR(", ", y);
579
     SERIAL_ECHOPAIR(", ", z);
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
   #if ENABLED(AUTO_BED_LEVELING_FEATURE)
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
   #endif
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
 #endif
593
 #endif
593
 
594
 
594
 #if ENABLED(DELTA) || ENABLED(SCARA)
595
 #if ENABLED(DELTA) || ENABLED(SCARA)
1540
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1541
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1541
       if (DEBUGGING(LEVELING)) {
1542
       if (DEBUGGING(LEVELING)) {
1542
         SERIAL_ECHOPAIR("> home_offset[axis]==", home_offset[axis]);
1543
         SERIAL_ECHOPAIR("> home_offset[axis]==", home_offset[axis]);
1544
+        SERIAL_EOL;
1543
         DEBUG_POS("", current_position);
1545
         DEBUG_POS("", current_position);
1544
       }
1546
       }
1545
     #endif
1547
     #endif
1653
     float old_feedrate = feedrate;
1655
     float old_feedrate = feedrate;
1654
 
1656
 
1655
     #if ENABLED(DEBUG_LEVELING_FEATURE)
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
     #endif
1659
     #endif
1658
 
1660
 
1659
     #if ENABLED(DELTA)
1661
     #if ENABLED(DELTA)
4327
 
4329
 
4328
     #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
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
        * 'heat and wait' M109.
4333
        * 'heat and wait' M109.
4332
        * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
4334
        * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
4333
        * stand by mode, for instance in a dual extruder setup, without affecting
4335
        * stand by mode, for instance in a dual extruder setup, without affecting
4639
       #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
4641
       #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
4640
         if (code_value_temp_abs() > BED_MINTEMP) {
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
           * functions never wait. Cooling down managed by extruders.
4645
           * functions never wait. Cooling down managed by extruders.
4644
           *
4646
           *
4645
           * We do not check if the timer is already running because this check will
4647
           * We do not check if the timer is already running because this check will

Loading…
Cancel
Save