Explorar el Código

Use varname as prefix in DEBUG_POS, string as suffix

Scott Lahteine hace 9 años
padre
commit
1e14df876d
Se han modificado 1 ficheros con 13 adiciones y 11 borrados
  1. 13
    11
      Marlin/Marlin_main.cpp

+ 13
- 11
Marlin/Marlin_main.cpp Ver fichero

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)
4333
 
4335
 
4334
     #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
4336
     #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
4335
       /**
4337
       /**
4336
-       * Stop the timer at the end of print, starting is managed by 
4338
+       * Stop the timer at the end of print, starting is managed by
4337
        * 'heat and wait' M109.
4339
        * 'heat and wait' M109.
4338
        * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
4340
        * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
4339
        * stand by mode, for instance in a dual extruder setup, without affecting
4341
        * stand by mode, for instance in a dual extruder setup, without affecting
4645
       #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
4647
       #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
4646
         if (code_value_temp_abs() > BED_MINTEMP) {
4648
         if (code_value_temp_abs() > BED_MINTEMP) {
4647
           /**
4649
           /**
4648
-          * We start the timer when 'heating and waiting' command arrives, LCD 
4650
+          * We start the timer when 'heating and waiting' command arrives, LCD
4649
           * functions never wait. Cooling down managed by extruders.
4651
           * functions never wait. Cooling down managed by extruders.
4650
           *
4652
           *
4651
           * We do not check if the timer is already running because this check will
4653
           * We do not check if the timer is already running because this check will

Loading…
Cancelar
Guardar