Browse Source

Merge pull request #4161 from thinkyhead/rc_general_cleanup

Reduce storage requirements for strings, make some PGM
Scott Lahteine 9 years ago
parent
commit
db19959735

+ 12
- 12
Marlin/M100_Free_Mem_Chk.cpp View File

@@ -86,7 +86,7 @@ void gcode_M100() {
86 86
     sp = top_of_stack();
87 87
     SERIAL_ECHOPGM("\nStack Pointer : ");
88 88
     prt_hex_word((unsigned int) sp);
89
-    SERIAL_ECHOPGM("\n");
89
+    SERIAL_EOL;
90 90
     sp = (unsigned char*)((unsigned long) sp | 0x000f);
91 91
     n = sp - ptr;
92 92
     //
@@ -94,25 +94,25 @@ void gcode_M100() {
94 94
     //
95 95
     while (ptr < sp) {
96 96
       prt_hex_word((unsigned int) ptr); // Print the address
97
-      SERIAL_ECHOPGM(":");
97
+      SERIAL_CHAR(':');
98 98
       for (i = 0; i < 16; i++) {      // and 16 data bytes
99 99
         prt_hex_byte(*(ptr + i));
100
-        SERIAL_ECHOPGM(" ");
100
+        SERIAL_CHAR(' ');
101 101
         delay(2);
102 102
       }
103
-      SERIAL_ECHO("|");         // now show where non 0xE5's are
103
+      SERIAL_CHAR('|');         // now show where non 0xE5's are
104 104
       for (i = 0; i < 16; i++) {
105 105
         delay(2);
106 106
         if (*(ptr + i) == 0xe5)
107
-          SERIAL_ECHOPGM(" ");
107
+          SERIAL_CHAR(' ');
108 108
         else
109
-          SERIAL_ECHOPGM("?");
109
+          SERIAL_CHAR('?');
110 110
       }
111
-      SERIAL_ECHO("\n");
111
+      SERIAL_EOL;
112 112
       ptr += 16;
113 113
       delay(2);
114 114
     }
115
-    SERIAL_ECHOLNPGM("Done.\n");
115
+    SERIAL_ECHOLNPGM("Done.");
116 116
     return;
117 117
   }
118 118
 #endif
@@ -137,7 +137,7 @@ void gcode_M100() {
137 137
           SERIAL_ECHOPAIR("Found ", j);
138 138
           SERIAL_ECHOPGM(" bytes free at 0x");
139 139
           prt_hex_word((int) ptr + i);
140
-          SERIAL_ECHOPGM("\n");
140
+          SERIAL_EOL;
141 141
           i += j;
142 142
           block_cnt++;
143 143
         }
@@ -150,8 +150,8 @@ void gcode_M100() {
150 150
       }
151 151
     }
152 152
     if (block_cnt > 1)
153
-      SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area.\n");
154
-    SERIAL_ECHO("\nDone.\n");
153
+      SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area.");
154
+    SERIAL_ECHOLNPGM("\nDone.");
155 155
     return;
156 156
   }
157 157
   //
@@ -173,7 +173,7 @@ void gcode_M100() {
173 173
     j = n / (x + 1);
174 174
     for (i = 1; i <= x; i++) {
175 175
       *(ptr + (i * j)) = i;
176
-      SERIAL_ECHO("\nCorrupting address: 0x");
176
+      SERIAL_ECHOPGM("\nCorrupting address: 0x");
177 177
       prt_hex_word((unsigned int)(ptr + (i * j)));
178 178
     }
179 179
     SERIAL_ECHOLNPGM("\n");

+ 2
- 1
Marlin/Marlin.h View File

@@ -84,8 +84,9 @@ typedef unsigned long millis_t;
84 84
 #define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y)
85 85
 #define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x))
86 86
 #define SERIAL_PROTOCOLLN(x) do{ MYSERIAL.print(x); SERIAL_EOL; }while(0)
87
-#define SERIAL_PROTOCOLLNPGM(x) do{ serialprintPGM(PSTR(x)); SERIAL_EOL; }while(0)
87
+#define SERIAL_PROTOCOLLNPGM(x) do{ serialprintPGM(PSTR(x "\n")); }while(0)
88 88
 
89
+#define SERIAL_PROTOCOLPAIR(name, value) SERIAL_ECHOPAIR(name, value)
89 90
 
90 91
 extern const char errormagic[] PROGMEM;
91 92
 extern const char echomagic[] PROGMEM;

+ 75
- 83
Marlin/Marlin_main.cpp View File

@@ -1442,8 +1442,8 @@ static void set_home_offset(AxisEnum axis, float v) {
1442 1442
 static void set_axis_is_at_home(AxisEnum axis) {
1443 1443
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1444 1444
     if (DEBUGGING(LEVELING)) {
1445
-      SERIAL_ECHOPAIR("set_axis_is_at_home(", axis);
1446
-      SERIAL_ECHOLNPGM(") >>>");
1445
+      SERIAL_ECHOPAIR(">>> set_axis_is_at_home(", axis);
1446
+      SERIAL_ECHOLNPGM(")");
1447 1447
     }
1448 1448
   #endif
1449 1449
 
@@ -1993,7 +1993,7 @@ static void clean_up_after_endstop_or_probe_move() {
1993 1993
       long start_steps = stepper.position(Z_AXIS);
1994 1994
 
1995 1995
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1996
-        if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("run_z_probe (DELTA) 1");
1996
+        if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe (DELTA) 1", current_position);
1997 1997
       #endif
1998 1998
 
1999 1999
       // move down slowly until you find the bed
@@ -2015,8 +2015,6 @@ static void clean_up_after_endstop_or_probe_move() {
2015 2015
         if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe (DELTA) 2", current_position);
2016 2016
       #endif
2017 2017
 
2018
-      SYNC_PLAN_POSITION_KINEMATIC();
2019
-
2020 2018
     #else // !DELTA
2021 2019
 
2022 2020
       #if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -2054,14 +2052,14 @@ static void clean_up_after_endstop_or_probe_move() {
2054 2052
       // Get the current stepper position after bumping an endstop
2055 2053
       current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS);
2056 2054
 
2057
-      SYNC_PLAN_POSITION_KINEMATIC();
2058
-
2059 2055
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2060 2056
         if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe", current_position);
2061 2057
       #endif
2062 2058
 
2063 2059
     #endif // !DELTA
2064 2060
 
2061
+    SYNC_PLAN_POSITION_KINEMATIC();
2062
+
2065 2063
     feedrate = old_feedrate;
2066 2064
 
2067 2065
     return current_position[Z_AXIS];
@@ -2083,9 +2081,10 @@ static void clean_up_after_endstop_or_probe_move() {
2083 2081
   static float probe_pt(float x, float y, bool stow = true, int verbose_level = 1) {
2084 2082
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2085 2083
       if (DEBUGGING(LEVELING)) {
2086
-        SERIAL_ECHOLNPGM("probe_pt >>>");
2087
-        SERIAL_ECHOPAIR("> stow:", stow);
2088
-        SERIAL_EOL;
2084
+        SERIAL_ECHOPAIR(">>> probe_pt(", x);
2085
+        SERIAL_ECHOPAIR(", ", y);
2086
+        SERIAL_ECHOPAIR(", ", stow ? "stow" : "no stow");
2087
+        SERIAL_ECHOLNPGM(")");
2089 2088
         DEBUG_POS("", current_position);
2090 2089
       }
2091 2090
     #endif
@@ -2107,7 +2106,7 @@ static void clean_up_after_endstop_or_probe_move() {
2107 2106
     do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER));
2108 2107
 
2109 2108
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2110
-      if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> deploy_z_probe");
2109
+      if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
2111 2110
     #endif
2112 2111
     deploy_z_probe();
2113 2112
 
@@ -2115,7 +2114,7 @@ static void clean_up_after_endstop_or_probe_move() {
2115 2114
 
2116 2115
     if (stow) {
2117 2116
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2118
-        if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> stow_z_probe");
2117
+        if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
2119 2118
       #endif
2120 2119
       stow_z_probe();
2121 2120
     }
@@ -2329,7 +2328,7 @@ static void homeaxis(AxisEnum axis) {
2329 2328
     #if HAS_BED_PROBE
2330 2329
       if (axis == Z_AXIS && axis_home_dir < 0) {
2331 2330
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2332
-          if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" > deploy_z_probe()");
2331
+          if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
2333 2332
         #endif
2334 2333
         deploy_z_probe();
2335 2334
       }
@@ -2453,7 +2452,7 @@ static void homeaxis(AxisEnum axis) {
2453 2452
     #if HAS_BED_PROBE
2454 2453
       if (axis == Z_AXIS && axis_home_dir < 0) {
2455 2454
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2456
-          if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" > stow_z_probe()");
2455
+          if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
2457 2456
         #endif
2458 2457
         stow_z_probe();
2459 2458
       }
@@ -2543,7 +2542,7 @@ void unknown_command_error() {
2543 2542
   SERIAL_ECHO_START;
2544 2543
   SERIAL_ECHOPGM(MSG_UNKNOWN_COMMAND);
2545 2544
   SERIAL_ECHO(current_command);
2546
-  SERIAL_ECHOPGM("\"\n");
2545
+  SERIAL_ECHOLNPGM("\"");
2547 2546
 }
2548 2547
 
2549 2548
 #if ENABLED(HOST_KEEPALIVE_FEATURE)
@@ -2741,7 +2740,7 @@ inline void gcode_G4() {
2741 2740
 inline void gcode_G28() {
2742 2741
 
2743 2742
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2744
-    if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("gcode_G28 >>>");
2743
+    if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(">>> gcode_G28");
2745 2744
   #endif
2746 2745
 
2747 2746
   // Wait for planner moves to finish!
@@ -3187,19 +3186,11 @@ inline void gcode_G28() {
3187 3186
     switch (state) {
3188 3187
       case MeshReport:
3189 3188
         if (mbl.has_mesh()) {
3190
-          SERIAL_PROTOCOLPGM("State: ");
3191
-          if (mbl.active())
3192
-            SERIAL_PROTOCOLPGM("On");
3193
-          else
3194
-            SERIAL_PROTOCOLPGM("Off");
3195
-          SERIAL_PROTOCOLPGM("\nNum X,Y: ");
3196
-          SERIAL_PROTOCOL(MESH_NUM_X_POINTS);
3197
-          SERIAL_PROTOCOLCHAR(',');
3198
-          SERIAL_PROTOCOL(MESH_NUM_Y_POINTS);
3199
-          SERIAL_PROTOCOLPGM("\nZ search height: ");
3200
-          SERIAL_PROTOCOL(MESH_HOME_SEARCH_Z);
3201
-          SERIAL_PROTOCOLPGM("\nZ offset: ");
3202
-          SERIAL_PROTOCOL_F(mbl.z_offset, 5);
3189
+          SERIAL_PROTOCOLPAIR("State: ", mbl.active() ? "On" : "Off");
3190
+          SERIAL_PROTOCOLPAIR("\nNum X,Y: ", MESH_NUM_X_POINTS);
3191
+          SERIAL_PROTOCOLCHAR(','); SERIAL_PROTOCOL(MESH_NUM_Y_POINTS);
3192
+          SERIAL_PROTOCOLPAIR("\nZ search height: ", MESH_HOME_SEARCH_Z);
3193
+          SERIAL_PROTOCOLPGM("\nZ offset: "); SERIAL_PROTOCOL_F(mbl.z_offset, 5);
3203 3194
           SERIAL_PROTOCOLLNPGM("\nMeasured points:");
3204 3195
           for (py = 0; py < MESH_NUM_Y_POINTS; py++) {
3205 3196
             for (px = 0; px < MESH_NUM_X_POINTS; px++) {
@@ -3268,30 +3259,30 @@ inline void gcode_G28() {
3268 3259
         if (code_seen('X')) {
3269 3260
           px = code_value_int() - 1;
3270 3261
           if (px < 0 || px >= MESH_NUM_X_POINTS) {
3271
-            SERIAL_PROTOCOLPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ").\n");
3262
+            SERIAL_PROTOCOLLNPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ").");
3272 3263
             return;
3273 3264
           }
3274 3265
         }
3275 3266
         else {
3276
-          SERIAL_PROTOCOLPGM("X not entered.\n");
3267
+          SERIAL_PROTOCOLLNPGM("X not entered.");
3277 3268
           return;
3278 3269
         }
3279 3270
         if (code_seen('Y')) {
3280 3271
           py = code_value_int() - 1;
3281 3272
           if (py < 0 || py >= MESH_NUM_Y_POINTS) {
3282
-            SERIAL_PROTOCOLPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ").\n");
3273
+            SERIAL_PROTOCOLLNPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ").");
3283 3274
             return;
3284 3275
           }
3285 3276
         }
3286 3277
         else {
3287
-          SERIAL_PROTOCOLPGM("Y not entered.\n");
3278
+          SERIAL_PROTOCOLLNPGM("Y not entered.");
3288 3279
           return;
3289 3280
         }
3290 3281
         if (code_seen('Z')) {
3291 3282
           z = code_value_axis_units(Z_AXIS);
3292 3283
         }
3293 3284
         else {
3294
-          SERIAL_PROTOCOLPGM("Z not entered.\n");
3285
+          SERIAL_PROTOCOLLNPGM("Z not entered.");
3295 3286
           return;
3296 3287
         }
3297 3288
         mbl.z_values[py][px] = z;
@@ -3302,7 +3293,7 @@ inline void gcode_G28() {
3302 3293
           z = code_value_axis_units(Z_AXIS);
3303 3294
         }
3304 3295
         else {
3305
-          SERIAL_PROTOCOLPGM("Z not entered.\n");
3296
+          SERIAL_PROTOCOLLNPGM("Z not entered.");
3306 3297
           return;
3307 3298
         }
3308 3299
         mbl.z_offset = z;
@@ -3368,7 +3359,7 @@ inline void gcode_G28() {
3368 3359
 
3369 3360
     #if ENABLED(DEBUG_LEVELING_FEATURE)
3370 3361
       if (DEBUGGING(LEVELING)) {
3371
-        SERIAL_ECHOLNPGM("gcode_G29 >>>");
3362
+        SERIAL_ECHOLNPGM(">>> gcode_G29");
3372 3363
         DEBUG_POS("", current_position);
3373 3364
       }
3374 3365
     #endif
@@ -3397,8 +3388,8 @@ inline void gcode_G28() {
3397 3388
       #endif
3398 3389
 
3399 3390
       if (verbose_level > 0) {
3400
-        SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling\n");
3401
-        if (dryrun) SERIAL_ECHOLNPGM("Running in DRY-RUN mode");
3391
+        SERIAL_PROTOCOLLNPGM("G29 Auto Bed Leveling");
3392
+        if (dryrun) SERIAL_PROTOCOLLNPGM("Running in DRY-RUN mode");
3402 3393
       }
3403 3394
 
3404 3395
       int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS;
@@ -3406,7 +3397,7 @@ inline void gcode_G28() {
3406 3397
       #if DISABLED(DELTA)
3407 3398
         if (code_seen('P')) auto_bed_leveling_grid_points = code_value_int();
3408 3399
         if (auto_bed_leveling_grid_points < 2) {
3409
-          SERIAL_PROTOCOLPGM("?Number of probed (P)oints is implausible (2 minimum).\n");
3400
+          SERIAL_PROTOCOLLNPGM("?Number of probed (P)oints is implausible (2 minimum).");
3410 3401
           return;
3411 3402
         }
3412 3403
       #endif
@@ -3637,17 +3628,17 @@ inline void gcode_G28() {
3637 3628
         // Show the Topography map if enabled
3638 3629
         if (do_topography_map) {
3639 3630
 
3640
-          SERIAL_PROTOCOLPGM(" \nBed Height Topography: \n");
3641
-          SERIAL_PROTOCOLPGM("   +--- BACK --+\n");
3642
-          SERIAL_PROTOCOLPGM("   |           |\n");
3643
-          SERIAL_PROTOCOLPGM(" L |    (+)    | R\n");
3644
-          SERIAL_PROTOCOLPGM(" E |           | I\n");
3645
-          SERIAL_PROTOCOLPGM(" F | (-) N (+) | G\n");
3646
-          SERIAL_PROTOCOLPGM(" T |           | H\n");
3647
-          SERIAL_PROTOCOLPGM("   |    (-)    | T\n");
3648
-          SERIAL_PROTOCOLPGM("   |           |\n");
3649
-          SERIAL_PROTOCOLPGM("   O-- FRONT --+\n");
3650
-          SERIAL_PROTOCOLPGM(" (0,0)\n");
3631
+          SERIAL_PROTOCOLLNPGM("\nBed Height Topography:\n"
3632
+                                 "   +--- BACK --+\n"
3633
+                                 "   |           |\n"
3634
+                                 " L |    (+)    | R\n"
3635
+                                 " E |           | I\n"
3636
+                                 " F | (-) N (+) | G\n"
3637
+                                 " T |           | H\n"
3638
+                                 "   |    (-)    | T\n"
3639
+                                 "   |           |\n"
3640
+                                 "   O-- FRONT --+\n"
3641
+                                 " (0,0)");
3651 3642
 
3652 3643
           float min_diff = 999;
3653 3644
 
@@ -3674,7 +3665,7 @@ inline void gcode_G28() {
3674 3665
           } // yy
3675 3666
           SERIAL_EOL;
3676 3667
           if (verbose_level > 3) {
3677
-            SERIAL_PROTOCOLPGM(" \nCorrected Bed Height vs. Bed Topology: \n");
3668
+            SERIAL_PROTOCOLLNPGM("\nCorrected Bed Height vs. Bed Topology:");
3678 3669
 
3679 3670
             for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) {
3680 3671
               for (int xx = 0; xx < auto_bed_leveling_grid_points; xx++) {
@@ -3703,7 +3694,7 @@ inline void gcode_G28() {
3703 3694
 
3704 3695
     #if DISABLED(DELTA)
3705 3696
       if (verbose_level > 0)
3706
-        planner.bed_level_matrix.debug(" \n\nBed Level Correction Matrix:");
3697
+        planner.bed_level_matrix.debug("\n\nBed Level Correction Matrix:");
3707 3698
 
3708 3699
       if (!dryrun) {
3709 3700
         /**
@@ -3747,7 +3738,7 @@ inline void gcode_G28() {
3747 3738
     #ifdef Z_PROBE_END_SCRIPT
3748 3739
       #if ENABLED(DEBUG_LEVELING_FEATURE)
3749 3740
         if (DEBUGGING(LEVELING)) {
3750
-          SERIAL_ECHO("Z Probe End Script: ");
3741
+          SERIAL_ECHOPGM("Z Probe End Script: ");
3751 3742
           SERIAL_ECHOLNPGM(Z_PROBE_END_SCRIPT);
3752 3743
         }
3753 3744
       #endif
@@ -4130,16 +4121,16 @@ inline void gcode_M42() {
4130 4121
 
4131 4122
     int8_t verbose_level = code_seen('V') ? code_value_byte() : 1;
4132 4123
     if (verbose_level < 0 || verbose_level > 4) {
4133
-      SERIAL_PROTOCOLPGM("?Verbose Level not plausible (0-4).\n");
4124
+      SERIAL_PROTOCOLLNPGM("?Verbose Level not plausible (0-4).");
4134 4125
       return;
4135 4126
     }
4136 4127
 
4137 4128
     if (verbose_level > 0)
4138
-      SERIAL_PROTOCOLPGM("M48 Z-Probe Repeatability test\n");
4129
+      SERIAL_PROTOCOLLNPGM("M48 Z-Probe Repeatability test");
4139 4130
 
4140 4131
     int8_t n_samples = code_seen('P') ? code_value_byte() : 10;
4141 4132
     if (n_samples < 4 || n_samples > 50) {
4142
-      SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n");
4133
+      SERIAL_PROTOCOLLNPGM("?Sample size not plausible (4-50).");
4143 4134
       return;
4144 4135
     }
4145 4136
 
@@ -4168,7 +4159,7 @@ inline void gcode_M42() {
4168 4159
       }
4169 4160
     #else
4170 4161
       if (sqrt(X_probe_location * X_probe_location + Y_probe_location * Y_probe_location) > DELTA_PROBEABLE_RADIUS) {
4171
-        SERIAL_PROTOCOLPGM("? (X,Y) location outside of probeable radius.\n");
4162
+        SERIAL_PROTOCOLLNPGM("? (X,Y) location outside of probeable radius.");
4172 4163
         return;
4173 4164
       }
4174 4165
     #endif
@@ -4176,7 +4167,7 @@ inline void gcode_M42() {
4176 4167
     bool seen_L = code_seen('L');
4177 4168
     uint8_t n_legs = seen_L ? code_value_byte() : 0;
4178 4169
     if (n_legs > 15) {
4179
-      SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n");
4170
+      SERIAL_PROTOCOLLNPGM("?Number of legs in movement not plausible (0-15).");
4180 4171
       return;
4181 4172
     }
4182 4173
     if (n_legs == 1) n_legs = 2;
@@ -4190,7 +4181,7 @@ inline void gcode_M42() {
4190 4181
      * we don't want to use that as a starting point for each probe.
4191 4182
      */
4192 4183
     if (verbose_level > 2)
4193
-      SERIAL_PROTOCOLPGM("Positioning the probe...\n");
4184
+      SERIAL_PROTOCOLLNPGM("Positioning the probe...");
4194 4185
 
4195 4186
     #if ENABLED(DELTA)
4196 4187
       // we don't do bed level correction in M48 because we want the raw data when we probe
@@ -4223,9 +4214,9 @@ inline void gcode_M42() {
4223 4214
         if (verbose_level > 3) {
4224 4215
           SERIAL_ECHOPAIR("Starting radius: ", radius);
4225 4216
           SERIAL_ECHOPAIR("   angle: ", angle);
4226
-          SERIAL_ECHO(" Direction: ");
4227
-          if (dir > 0) SERIAL_ECHO("Counter ");
4228
-          SERIAL_ECHOLN("Clockwise");
4217
+          SERIAL_ECHOPGM(" Direction: ");
4218
+          if (dir > 0) SERIAL_ECHOPGM("Counter-");
4219
+          SERIAL_ECHOLNPGM("Clockwise");
4229 4220
         }
4230 4221
 
4231 4222
         for (uint8_t l = 0; l < n_legs - 1; l++) {
@@ -4268,10 +4259,10 @@ inline void gcode_M42() {
4268 4259
             }
4269 4260
           #endif
4270 4261
           if (verbose_level > 3) {
4271
-            SERIAL_PROTOCOL("Going to:");
4272
-            SERIAL_ECHOPAIR("x: ", X_current);
4273
-            SERIAL_ECHOPAIR("y: ", Y_current);
4274
-            SERIAL_ECHOPAIR("  z: ", current_position[Z_AXIS]);
4262
+            SERIAL_PROTOCOLPGM("Going to:");
4263
+            SERIAL_ECHOPAIR(" X", X_current);
4264
+            SERIAL_ECHOPAIR(" Y", Y_current);
4265
+            SERIAL_ECHOPAIR(" Z", current_position[Z_AXIS]);
4275 4266
             SERIAL_EOL;
4276 4267
           }
4277 4268
           do_blocking_move_to_xy(X_current, Y_current);
@@ -5542,9 +5533,9 @@ inline void gcode_M226() {
5542 5533
     }
5543 5534
     else if (servo_index >= 0) {
5544 5535
       SERIAL_ECHO_START;
5545
-      SERIAL_ECHO(" Servo ");
5536
+      SERIAL_ECHOPGM(" Servo ");
5546 5537
       SERIAL_ECHO(servo_index);
5547
-      SERIAL_ECHO(": ");
5538
+      SERIAL_ECHOPGM(": ");
5548 5539
       SERIAL_ECHOLN(servo[servo_index].read());
5549 5540
     }
5550 5541
   }
@@ -5601,17 +5592,17 @@ inline void gcode_M226() {
5601 5592
       thermalManager.updatePID();
5602 5593
       SERIAL_ECHO_START;
5603 5594
       #if ENABLED(PID_PARAMS_PER_HOTEND)
5604
-        SERIAL_ECHO(" e:"); // specify extruder in serial output
5595
+        SERIAL_ECHOPGM(" e:"); // specify extruder in serial output
5605 5596
         SERIAL_ECHO(e);
5606 5597
       #endif // PID_PARAMS_PER_HOTEND
5607
-      SERIAL_ECHO(" p:");
5598
+      SERIAL_ECHOPGM(" p:");
5608 5599
       SERIAL_ECHO(PID_PARAM(Kp, e));
5609
-      SERIAL_ECHO(" i:");
5600
+      SERIAL_ECHOPGM(" i:");
5610 5601
       SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e)));
5611
-      SERIAL_ECHO(" d:");
5602
+      SERIAL_ECHOPGM(" d:");
5612 5603
       SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e)));
5613 5604
       #if ENABLED(PID_ADD_EXTRUSION_RATE)
5614
-        SERIAL_ECHO(" c:");
5605
+        SERIAL_ECHOPGM(" c:");
5615 5606
         //Kc does not have scaling applied above, or in resetting defaults
5616 5607
         SERIAL_ECHO(PID_PARAM(Kc, e));
5617 5608
       #endif
@@ -5635,11 +5626,11 @@ inline void gcode_M226() {
5635 5626
     thermalManager.updatePID();
5636 5627
 
5637 5628
     SERIAL_ECHO_START;
5638
-    SERIAL_ECHO(" p:");
5629
+    SERIAL_ECHOPGM(" p:");
5639 5630
     SERIAL_ECHO(thermalManager.bedKp);
5640
-    SERIAL_ECHO(" i:");
5631
+    SERIAL_ECHOPGM(" i:");
5641 5632
     SERIAL_ECHO(unscalePID_i(thermalManager.bedKi));
5642
-    SERIAL_ECHO(" d:");
5633
+    SERIAL_ECHOPGM(" d:");
5643 5634
     SERIAL_ECHOLN(unscalePID_d(thermalManager.bedKd));
5644 5635
   }
5645 5636
 
@@ -5739,7 +5730,7 @@ inline void gcode_M303() {
5739 5730
 #if ENABLED(SCARA)
5740 5731
   bool SCARA_move_to_cal(uint8_t delta_x, uint8_t delta_y) {
5741 5732
     //SoftEndsEnabled = false;              // Ignore soft endstops during calibration
5742
-    //SERIAL_ECHOLN(" Soft endstops disabled ");
5733
+    //SERIAL_ECHOLNPGM(" Soft endstops disabled");
5743 5734
     if (IsRunning()) {
5744 5735
       //gcode_get_destination(); // For X Y Z E F
5745 5736
       delta[X_AXIS] = delta_x;
@@ -5758,7 +5749,7 @@ inline void gcode_M303() {
5758 5749
    * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
5759 5750
    */
5760 5751
   inline bool gcode_M360() {
5761
-    SERIAL_ECHOLN(" Cal: Theta 0 ");
5752
+    SERIAL_ECHOLNPGM(" Cal: Theta 0");
5762 5753
     return SCARA_move_to_cal(0, 120);
5763 5754
   }
5764 5755
 
@@ -5766,7 +5757,7 @@ inline void gcode_M303() {
5766 5757
    * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
5767 5758
    */
5768 5759
   inline bool gcode_M361() {
5769
-    SERIAL_ECHOLN(" Cal: Theta 90 ");
5760
+    SERIAL_ECHOLNPGM(" Cal: Theta 90");
5770 5761
     return SCARA_move_to_cal(90, 130);
5771 5762
   }
5772 5763
 
@@ -5774,7 +5765,7 @@ inline void gcode_M303() {
5774 5765
    * M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration)
5775 5766
    */
5776 5767
   inline bool gcode_M362() {
5777
-    SERIAL_ECHOLN(" Cal: Psi 0 ");
5768
+    SERIAL_ECHOLNPGM(" Cal: Psi 0");
5778 5769
     return SCARA_move_to_cal(60, 180);
5779 5770
   }
5780 5771
 
@@ -5782,7 +5773,7 @@ inline void gcode_M303() {
5782 5773
    * M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
5783 5774
    */
5784 5775
   inline bool gcode_M363() {
5785
-    SERIAL_ECHOLN(" Cal: Psi 90 ");
5776
+    SERIAL_ECHOLNPGM(" Cal: Psi 90");
5786 5777
     return SCARA_move_to_cal(50, 90);
5787 5778
   }
5788 5779
 
@@ -5790,7 +5781,7 @@ inline void gcode_M303() {
5790 5781
    * M364: SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
5791 5782
    */
5792 5783
   inline bool gcode_M364() {
5793
-    SERIAL_ECHOLN(" Cal: Theta-Psi 90 ");
5784
+    SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90");
5794 5785
     return SCARA_move_to_cal(45, 135);
5795 5786
   }
5796 5787
 
@@ -6109,6 +6100,7 @@ inline void gcode_M503() {
6109 6100
       else {
6110 6101
         SERIAL_ECHOPGM(MSG_Z_MIN);
6111 6102
         SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MIN);
6103
+        SERIAL_CHAR(' ');
6112 6104
         SERIAL_ECHOPGM(MSG_Z_MAX);
6113 6105
         SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MAX);
6114 6106
       }
@@ -6625,7 +6617,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
6625 6617
   #endif
6626 6618
 
6627 6619
   SERIAL_ECHO_START;
6628
-  SERIAL_ECHO(MSG_ACTIVE_EXTRUDER);
6620
+  SERIAL_ECHOPGM(MSG_ACTIVE_EXTRUDER);
6629 6621
   SERIAL_PROTOCOLLN((int)active_extruder);
6630 6622
 }
6631 6623
 

+ 20
- 23
Marlin/cardreader.cpp View File

@@ -102,7 +102,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
102 102
       if (!dir.open(parent, lfilename, O_READ)) {
103 103
         if (lsAction == LS_SerialPrint) {
104 104
           SERIAL_ECHO_START;
105
-          SERIAL_ECHOLN(MSG_SD_CANT_OPEN_SUBDIR);
105
+          SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR);
106 106
           SERIAL_ECHOLN(lfilename);
107 107
         }
108 108
       }
@@ -357,8 +357,8 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
357 357
     dirname_start = &name[1];
358 358
     while (dirname_start != NULL) {
359 359
       dirname_end = strchr(dirname_start, '/');
360
-      //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
361
-      //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
360
+      //SERIAL_ECHOPGM("start:");SERIAL_ECHOLN((int)(dirname_start - name));
361
+      //SERIAL_ECHOPGM("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
362 362
       if (dirname_end != NULL && dirname_end > dirname_start) {
363 363
         char subdirname[FILENAME_LENGTH];
364 364
         strncpy(subdirname, dirname_start, dirname_end - dirname_start);
@@ -371,7 +371,7 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
371 371
           return;
372 372
         }
373 373
         else {
374
-          //SERIAL_ECHOLN("dive ok");
374
+          //SERIAL_ECHOLNPGM("dive ok");
375 375
         }
376 376
 
377 377
         curDir = &myDir;
@@ -379,7 +379,7 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
379 379
       }
380 380
       else { // the remainder after all /fsa/fdsa/ is the filename
381 381
         fname = dirname_start;
382
-        //SERIAL_ECHOLN("remainder");
382
+        //SERIAL_ECHOLNPGM("remainder");
383 383
         //SERIAL_ECHOLN(fname);
384 384
         break;
385 385
       }
@@ -392,10 +392,9 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
392 392
   if (read) {
393 393
     if (file.open(curDir, fname, O_READ)) {
394 394
       filesize = file.fileSize();
395
-      SERIAL_PROTOCOLPGM(MSG_SD_FILE_OPENED);
396
-      SERIAL_PROTOCOL(fname);
397
-      SERIAL_PROTOCOLPGM(MSG_SD_SIZE);
398
-      SERIAL_PROTOCOLLN(filesize);
395
+      SERIAL_PROTOCOLPAIR(MSG_SD_FILE_OPENED, fname);
396
+      SERIAL_PROTOCOLPAIR(MSG_SD_SIZE, filesize);
397
+      SERIAL_EOL;
399 398
       sdpos = 0;
400 399
 
401 400
       SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED);
@@ -403,21 +402,20 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
403 402
       lcd_setstatus(longFilename[0] ? longFilename : fname);
404 403
     }
405 404
     else {
406
-      SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
407
-      SERIAL_PROTOCOL(fname);
408
-      SERIAL_PROTOCOLPGM(".\n");
405
+      SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname);
406
+      SERIAL_PROTOCOLCHAR('.');
407
+      SERIAL_EOL;
409 408
     }
410 409
   }
411 410
   else { //write
412 411
     if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) {
413
-      SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
414
-      SERIAL_PROTOCOL(fname);
415
-      SERIAL_PROTOCOLPGM(".\n");
412
+      SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname);
413
+      SERIAL_PROTOCOLCHAR('.');
414
+      SERIAL_EOL;
416 415
     }
417 416
     else {
418 417
       saving = true;
419
-      SERIAL_PROTOCOLPGM(MSG_SD_WRITE_TO_FILE);
420
-      SERIAL_PROTOCOLLN(name);
418
+      SERIAL_PROTOCOLPAIR(MSG_SD_WRITE_TO_FILE, name);
421 419
       lcd_setstatus(fname);
422 420
     }
423 421
   }
@@ -438,21 +436,20 @@ void CardReader::removeFile(char* name) {
438 436
     dirname_start = strchr(name, '/') + 1;
439 437
     while (dirname_start != NULL) {
440 438
       dirname_end = strchr(dirname_start, '/');
441
-      //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
442
-      //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
439
+      //SERIAL_ECHOPGM("start:");SERIAL_ECHOLN((int)(dirname_start - name));
440
+      //SERIAL_ECHOPGM("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
443 441
       if (dirname_end != NULL && dirname_end > dirname_start) {
444 442
         char subdirname[FILENAME_LENGTH];
445 443
         strncpy(subdirname, dirname_start, dirname_end - dirname_start);
446 444
         subdirname[dirname_end - dirname_start] = 0;
447 445
         SERIAL_ECHOLN(subdirname);
448 446
         if (!myDir.open(curDir, subdirname, O_READ)) {
449
-          SERIAL_PROTOCOLPGM("open failed, File: ");
450
-          SERIAL_PROTOCOL(subdirname);
447
+          SERIAL_PROTOCOLPAIR("open failed, File: ", subdirname);
451 448
           SERIAL_PROTOCOLCHAR('.');
452 449
           return;
453 450
         }
454 451
         else {
455
-          //SERIAL_ECHOLN("dive ok");
452
+          //SERIAL_ECHOLNPGM("dive ok");
456 453
         }
457 454
 
458 455
         curDir = &myDir;
@@ -460,7 +457,7 @@ void CardReader::removeFile(char* name) {
460 457
       }
461 458
       else { // the remainder after all /fsa/fdsa/ is the filename
462 459
         fname = dirname_start;
463
-        //SERIAL_ECHOLN("remainder");
460
+        //SERIAL_ECHOLNPGM("remainder");
464 461
         //SERIAL_ECHOLN(fname);
465 462
         break;
466 463
       }

+ 5
- 3
Marlin/configuration_store.cpp View File

@@ -344,7 +344,9 @@ void Config_RetrieveSettings() {
344 344
   char stored_ver[4];
345 345
   char ver[4] = EEPROM_VERSION;
346 346
   EEPROM_READ_VAR(i, stored_ver); //read stored version
347
-  //  SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << stored_ver << "]");
347
+  //  SERIAL_ECHOPAIR("Version: [", ver);
348
+  //  SERIAL_ECHOPAIR("] Stored version: [", stored_ver);
349
+  //  SERIAL_ECHOLNPGM("]");
348 350
 
349 351
   if (strncmp(ver, stored_ver, 3) != 0) {
350 352
     Config_ResetDefault();
@@ -717,7 +719,7 @@ void Config_PrintSettings(bool forReplay) {
717 719
 
718 720
   CONFIG_ECHO_START;
719 721
   if (!forReplay) {
720
-    SERIAL_ECHOLNPGM("Home offset (mm):");
722
+    SERIAL_ECHOLNPGM("Home offset (mm)");
721 723
     CONFIG_ECHO_START;
722 724
   }
723 725
   SERIAL_ECHOPAIR("  M206 X", home_offset[X_AXIS]);
@@ -883,7 +885,7 @@ void Config_PrintSettings(bool forReplay) {
883 885
       SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries");
884 886
       CONFIG_ECHO_START;
885 887
     }
886
-    SERIAL_ECHOPAIR("  M209 S", (autoretract_enabled ? 1 : 0));
888
+    SERIAL_ECHOPAIR("  M209 S", autoretract_enabled ? 1 : 0);
887 889
     SERIAL_EOL;
888 890
 
889 891
   #endif // FWRETRACT

+ 1
- 1
Marlin/endstops.cpp View File

@@ -197,7 +197,7 @@ void Endstops::report_state() {
197 197
 } // Endstops::report_state
198 198
 
199 199
 void Endstops::M119() {
200
-  SERIAL_PROTOCOLLN(MSG_M119_REPORT);
200
+  SERIAL_PROTOCOLLNPGM(MSG_M119_REPORT);
201 201
   #if HAS_X_MIN
202 202
     SERIAL_PROTOCOLPGM(MSG_X_MIN);
203 203
     SERIAL_PROTOCOLLN(((READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN));

+ 1
- 1
Marlin/language.h View File

@@ -157,7 +157,7 @@
157 157
 #define MSG_ENDSTOP_OPEN                    "open"
158 158
 #define MSG_HOTEND_OFFSET                   "Hotend offsets:"
159 159
 
160
-#define MSG_SD_CANT_OPEN_SUBDIR             "Cannot open subdir"
160
+#define MSG_SD_CANT_OPEN_SUBDIR             "Cannot open subdir "
161 161
 #define MSG_SD_INIT_FAIL                    "SD init fail"
162 162
 #define MSG_SD_VOL_INIT_FAIL                "volume.init failed"
163 163
 #define MSG_SD_OPENROOT_FAIL                "openRoot failed"

+ 1
- 1
Marlin/stepper.cpp View File

@@ -1103,7 +1103,7 @@ void Stepper::microstep_mode(uint8_t driver, uint8_t stepping_mode) {
1103 1103
 }
1104 1104
 
1105 1105
 void Stepper::microstep_readings() {
1106
-  SERIAL_PROTOCOLPGM("MS1,MS2 Pins\n");
1106
+  SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins");
1107 1107
   SERIAL_PROTOCOLPGM("X: ");
1108 1108
   SERIAL_PROTOCOL(digitalRead(X_MS1_PIN));
1109 1109
   SERIAL_PROTOCOLLN(digitalRead(X_MS2_PIN));

+ 1
- 1
Marlin/stepper_dac.cpp View File

@@ -103,7 +103,7 @@
103 103
     SERIAL_ECHOPAIR(" (",   dac_amps(2));
104 104
     SERIAL_ECHOPAIR(") E:", dac_perc(3));
105 105
     SERIAL_ECHOPAIR(" (",   dac_amps(3));
106
-    SERIAL_ECHOLN(")");
106
+    SERIAL_ECHOLNPGM(")");
107 107
   }
108 108
 
109 109
   void dac_commit_eeprom() {

+ 32
- 32
Marlin/temperature.cpp View File

@@ -304,37 +304,37 @@ unsigned char Temperature::soft_pwm[HOTENDS];
304 304
               bias = constrain(bias, 20, max_pow - 20);
305 305
               d = (bias > max_pow / 2) ? max_pow - 1 - bias : bias;
306 306
 
307
-              SERIAL_PROTOCOLPGM(MSG_BIAS); SERIAL_PROTOCOL(bias);
308
-              SERIAL_PROTOCOLPGM(MSG_D);    SERIAL_PROTOCOL(d);
309
-              SERIAL_PROTOCOLPGM(MSG_T_MIN);  SERIAL_PROTOCOL(min);
310
-              SERIAL_PROTOCOLPGM(MSG_T_MAX);  SERIAL_PROTOCOLLN(max);
307
+              SERIAL_PROTOCOLPAIR(MSG_BIAS, bias);
308
+              SERIAL_PROTOCOLPAIR(MSG_D, d);
309
+              SERIAL_PROTOCOLPAIR(MSG_T_MIN, min);
310
+              SERIAL_PROTOCOLPAIR(MSG_T_MAX, max);
311 311
               if (cycles > 2) {
312 312
                 Ku = (4.0 * d) / (3.14159265 * (max - min) / 2.0);
313 313
                 Tu = ((float)(t_low + t_high) / 1000.0);
314
-                SERIAL_PROTOCOLPGM(MSG_KU); SERIAL_PROTOCOL(Ku);
315
-                SERIAL_PROTOCOLPGM(MSG_TU); SERIAL_PROTOCOLLN(Tu);
314
+                SERIAL_PROTOCOLPAIR(MSG_KU, Ku);
315
+                SERIAL_PROTOCOLPAIR(MSG_TU, Tu);
316 316
                 workKp = 0.6 * Ku;
317 317
                 workKi = 2 * workKp / Tu;
318 318
                 workKd = workKp * Tu / 8;
319 319
                 SERIAL_PROTOCOLLNPGM(MSG_CLASSIC_PID);
320
-                SERIAL_PROTOCOLPGM(MSG_KP); SERIAL_PROTOCOLLN(workKp);
321
-                SERIAL_PROTOCOLPGM(MSG_KI); SERIAL_PROTOCOLLN(workKi);
322
-                SERIAL_PROTOCOLPGM(MSG_KD); SERIAL_PROTOCOLLN(workKd);
320
+                SERIAL_PROTOCOLPAIR(MSG_KP, workKp);
321
+                SERIAL_PROTOCOLPAIR(MSG_KI, workKi);
322
+                SERIAL_PROTOCOLPAIR(MSG_KD, workKd);
323 323
                 /**
324 324
                 workKp = 0.33*Ku;
325 325
                 workKi = workKp/Tu;
326 326
                 workKd = workKp*Tu/3;
327
-                SERIAL_PROTOCOLLNPGM(" Some overshoot ");
328
-                SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(workKp);
329
-                SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(workKi);
330
-                SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(workKd);
327
+                SERIAL_PROTOCOLLNPGM(" Some overshoot");
328
+                SERIAL_PROTOCOLPAIR(" Kp: ", workKp);
329
+                SERIAL_PROTOCOLPAIR(" Ki: ", workKi);
330
+                SERIAL_PROTOCOLPAIR(" Kd: ", workKd);
331 331
                 workKp = 0.2*Ku;
332 332
                 workKi = 2*workKp/Tu;
333 333
                 workKd = workKp*Tu/3;
334
-                SERIAL_PROTOCOLLNPGM(" No overshoot ");
335
-                SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(workKp);
336
-                SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(workKi);
337
-                SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(workKd);
334
+                SERIAL_PROTOCOLLNPGM(" No overshoot");
335
+                SERIAL_PROTOCOLPAIR(" Kp: ", workKp);
336
+                SERIAL_PROTOCOLPAIR(" Ki: ", workKi);
337
+                SERIAL_PROTOCOLPAIR(" Kd: ", workKd);
338 338
                 */
339 339
               }
340 340
             }
@@ -377,17 +377,17 @@ unsigned char Temperature::soft_pwm[HOTENDS];
377 377
 
378 378
         #if HAS_PID_FOR_BOTH
379 379
           const char* estring = hotend < 0 ? "bed" : "";
380
-          SERIAL_PROTOCOLPGM("#define  DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Kp "); SERIAL_PROTOCOLLN(workKp);
381
-          SERIAL_PROTOCOLPGM("#define  DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Ki "); SERIAL_PROTOCOLLN(workKi);
382
-          SERIAL_PROTOCOLPGM("#define  DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Kd "); SERIAL_PROTOCOLLN(workKd);
380
+          SERIAL_PROTOCOLPAIR("#define  DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kp ", workKp);
381
+          SERIAL_PROTOCOLPAIR("#define  DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Ki ", workKi);
382
+          SERIAL_PROTOCOLPAIR("#define  DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kd ", workKd);
383 383
         #elif ENABLED(PIDTEMP)
384
-          SERIAL_PROTOCOLPGM("#define  DEFAULT_Kp "); SERIAL_PROTOCOLLN(workKp);
385
-          SERIAL_PROTOCOLPGM("#define  DEFAULT_Ki "); SERIAL_PROTOCOLLN(workKi);
386
-          SERIAL_PROTOCOLPGM("#define  DEFAULT_Kd "); SERIAL_PROTOCOLLN(workKd);
384
+          SERIAL_PROTOCOLPAIR("#define  DEFAULT_Kp ", workKp);
385
+          SERIAL_PROTOCOLPAIR("#define  DEFAULT_Ki ", workKi);
386
+          SERIAL_PROTOCOLPAIR("#define  DEFAULT_Kd ", workKd);
387 387
         #else
388
-          SERIAL_PROTOCOLPGM("#define  DEFAULT_bedKp "); SERIAL_PROTOCOLLN(workKp);
389
-          SERIAL_PROTOCOLPGM("#define  DEFAULT_bedKi "); SERIAL_PROTOCOLLN(workKi);
390
-          SERIAL_PROTOCOLPGM("#define  DEFAULT_bedKd "); SERIAL_PROTOCOLLN(workKd);
388
+          SERIAL_PROTOCOLPAIR("#define  DEFAULT_bedKp ", workKp);
389
+          SERIAL_PROTOCOLPAIR("#define  DEFAULT_bedKi ", workKi);
390
+          SERIAL_PROTOCOLPAIR("#define  DEFAULT_bedKd ", workKd);
391 391
         #endif
392 392
 
393 393
         #define _SET_BED_PID() \
@@ -626,16 +626,16 @@ float Temperature::get_pid_output(int e) {
626 626
 
627 627
     #if ENABLED(PID_BED_DEBUG)
628 628
       SERIAL_ECHO_START;
629
-      SERIAL_ECHO(" PID_BED_DEBUG ");
630
-      SERIAL_ECHO(": Input ");
629
+      SERIAL_ECHOPGM(" PID_BED_DEBUG ");
630
+      SERIAL_ECHOPGM(": Input ");
631 631
       SERIAL_ECHO(current_temperature_bed);
632
-      SERIAL_ECHO(" Output ");
632
+      SERIAL_ECHOPGM(" Output ");
633 633
       SERIAL_ECHO(pid_output);
634
-      SERIAL_ECHO(" pTerm ");
634
+      SERIAL_ECHOPGM(" pTerm ");
635 635
       SERIAL_ECHO(pTerm_bed);
636
-      SERIAL_ECHO(" iTerm ");
636
+      SERIAL_ECHOPGM(" iTerm ");
637 637
       SERIAL_ECHO(iTerm_bed);
638
-      SERIAL_ECHO(" dTerm ");
638
+      SERIAL_ECHOPGM(" dTerm ");
639 639
       SERIAL_ECHOLN(dTerm_bed);
640 640
     #endif //PID_BED_DEBUG
641 641
 

+ 5
- 8
Marlin/ultralcd.cpp View File

@@ -2266,14 +2266,11 @@ void lcd_update() {
2266 2266
 
2267 2267
                 #if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG)
2268 2268
                   SERIAL_ECHO_START;
2269
-                  SERIAL_ECHO("Enc Step Rate: ");
2270
-                  SERIAL_ECHO(encoderStepRate);
2271
-                  SERIAL_ECHO("  Multiplier: ");
2272
-                  SERIAL_ECHO(encoderMultiplier);
2273
-                  SERIAL_ECHO("  ENCODER_10X_STEPS_PER_SEC: ");
2274
-                  SERIAL_ECHO(ENCODER_10X_STEPS_PER_SEC);
2275
-                  SERIAL_ECHO("  ENCODER_100X_STEPS_PER_SEC: ");
2276
-                  SERIAL_ECHOLN(ENCODER_100X_STEPS_PER_SEC);
2269
+                  SERIAL_ECHOPAIR("Enc Step Rate: ", encoderStepRate);
2270
+                  SERIAL_ECHOPAIR("  Multiplier: ", encoderMultiplier);
2271
+                  SERIAL_ECHOPAIR("  ENCODER_10X_STEPS_PER_SEC: ", ENCODER_10X_STEPS_PER_SEC);
2272
+                  SERIAL_ECHOPAIR("  ENCODER_100X_STEPS_PER_SEC: ", ENCODER_100X_STEPS_PER_SEC);
2273
+                  SERIAL_EOL;
2277 2274
                 #endif //ENCODER_RATE_MULTIPLIER_DEBUG
2278 2275
               }
2279 2276
 

Loading…
Cancel
Save