Browse Source

Reduce storage requirements for strings, make some PGM

Scott Lahteine 8 years ago
parent
commit
bd491818d6

+ 12
- 12
Marlin/M100_Free_Mem_Chk.cpp View File

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

+ 2
- 1
Marlin/Marlin.h View File

84
 #define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y)
84
 #define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y)
85
 #define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x))
85
 #define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x))
86
 #define SERIAL_PROTOCOLLN(x) do{ MYSERIAL.print(x); SERIAL_EOL; }while(0)
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
 extern const char errormagic[] PROGMEM;
91
 extern const char errormagic[] PROGMEM;
91
 extern const char echomagic[] PROGMEM;
92
 extern const char echomagic[] PROGMEM;

+ 61
- 68
Marlin/Marlin_main.cpp View File

2107
     do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER));
2107
     do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER));
2108
 
2108
 
2109
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2109
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2110
-      if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> deploy_z_probe");
2110
+      if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
2111
     #endif
2111
     #endif
2112
     deploy_z_probe();
2112
     deploy_z_probe();
2113
 
2113
 
2543
   SERIAL_ECHO_START;
2543
   SERIAL_ECHO_START;
2544
   SERIAL_ECHOPGM(MSG_UNKNOWN_COMMAND);
2544
   SERIAL_ECHOPGM(MSG_UNKNOWN_COMMAND);
2545
   SERIAL_ECHO(current_command);
2545
   SERIAL_ECHO(current_command);
2546
-  SERIAL_ECHOPGM("\"\n");
2546
+  SERIAL_ECHOLNPGM("\"");
2547
 }
2547
 }
2548
 
2548
 
2549
 #if ENABLED(HOST_KEEPALIVE_FEATURE)
2549
 #if ENABLED(HOST_KEEPALIVE_FEATURE)
3187
     switch (state) {
3187
     switch (state) {
3188
       case MeshReport:
3188
       case MeshReport:
3189
         if (mbl.has_mesh()) {
3189
         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);
3190
+          SERIAL_PROTOCOLPAIR("State: ", mbl.active() ? "On" : "Off");
3191
+          SERIAL_PROTOCOLPAIR("\nNum X,Y: ", MESH_NUM_X_POINTS);
3192
+          SERIAL_PROTOCOLCHAR(','); SERIAL_PROTOCOL(MESH_NUM_Y_POINTS);
3193
+          SERIAL_PROTOCOLPAIR("\nZ search height: ", MESH_HOME_SEARCH_Z);
3194
+          SERIAL_PROTOCOLPGM("\nZ offset: "); SERIAL_PROTOCOL_F(mbl.z_offset, 5);
3203
           SERIAL_PROTOCOLLNPGM("\nMeasured points:");
3195
           SERIAL_PROTOCOLLNPGM("\nMeasured points:");
3204
           for (py = 0; py < MESH_NUM_Y_POINTS; py++) {
3196
           for (py = 0; py < MESH_NUM_Y_POINTS; py++) {
3205
             for (px = 0; px < MESH_NUM_X_POINTS; px++) {
3197
             for (px = 0; px < MESH_NUM_X_POINTS; px++) {
3268
         if (code_seen('X')) {
3260
         if (code_seen('X')) {
3269
           px = code_value_int() - 1;
3261
           px = code_value_int() - 1;
3270
           if (px < 0 || px >= MESH_NUM_X_POINTS) {
3262
           if (px < 0 || px >= MESH_NUM_X_POINTS) {
3271
-            SERIAL_PROTOCOLPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ").\n");
3263
+            SERIAL_PROTOCOLLNPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ").");
3272
             return;
3264
             return;
3273
           }
3265
           }
3274
         }
3266
         }
3275
         else {
3267
         else {
3276
-          SERIAL_PROTOCOLPGM("X not entered.\n");
3268
+          SERIAL_PROTOCOLLNPGM("X not entered.");
3277
           return;
3269
           return;
3278
         }
3270
         }
3279
         if (code_seen('Y')) {
3271
         if (code_seen('Y')) {
3280
           py = code_value_int() - 1;
3272
           py = code_value_int() - 1;
3281
           if (py < 0 || py >= MESH_NUM_Y_POINTS) {
3273
           if (py < 0 || py >= MESH_NUM_Y_POINTS) {
3282
-            SERIAL_PROTOCOLPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ").\n");
3274
+            SERIAL_PROTOCOLLNPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ").");
3283
             return;
3275
             return;
3284
           }
3276
           }
3285
         }
3277
         }
3286
         else {
3278
         else {
3287
-          SERIAL_PROTOCOLPGM("Y not entered.\n");
3279
+          SERIAL_PROTOCOLLNPGM("Y not entered.");
3288
           return;
3280
           return;
3289
         }
3281
         }
3290
         if (code_seen('Z')) {
3282
         if (code_seen('Z')) {
3291
           z = code_value_axis_units(Z_AXIS);
3283
           z = code_value_axis_units(Z_AXIS);
3292
         }
3284
         }
3293
         else {
3285
         else {
3294
-          SERIAL_PROTOCOLPGM("Z not entered.\n");
3286
+          SERIAL_PROTOCOLLNPGM("Z not entered.");
3295
           return;
3287
           return;
3296
         }
3288
         }
3297
         mbl.z_values[py][px] = z;
3289
         mbl.z_values[py][px] = z;
3302
           z = code_value_axis_units(Z_AXIS);
3294
           z = code_value_axis_units(Z_AXIS);
3303
         }
3295
         }
3304
         else {
3296
         else {
3305
-          SERIAL_PROTOCOLPGM("Z not entered.\n");
3297
+          SERIAL_PROTOCOLLNPGM("Z not entered.");
3306
           return;
3298
           return;
3307
         }
3299
         }
3308
         mbl.z_offset = z;
3300
         mbl.z_offset = z;
3397
       #endif
3389
       #endif
3398
 
3390
 
3399
       if (verbose_level > 0) {
3391
       if (verbose_level > 0) {
3400
-        SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling\n");
3401
-        if (dryrun) SERIAL_ECHOLNPGM("Running in DRY-RUN mode");
3392
+        SERIAL_PROTOCOLLNPGM("G29 Auto Bed Leveling");
3393
+        if (dryrun) SERIAL_PROTOCOLLNPGM("Running in DRY-RUN mode");
3402
       }
3394
       }
3403
 
3395
 
3404
       int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS;
3396
       int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS;
3406
       #if DISABLED(DELTA)
3398
       #if DISABLED(DELTA)
3407
         if (code_seen('P')) auto_bed_leveling_grid_points = code_value_int();
3399
         if (code_seen('P')) auto_bed_leveling_grid_points = code_value_int();
3408
         if (auto_bed_leveling_grid_points < 2) {
3400
         if (auto_bed_leveling_grid_points < 2) {
3409
-          SERIAL_PROTOCOLPGM("?Number of probed (P)oints is implausible (2 minimum).\n");
3401
+          SERIAL_PROTOCOLLNPGM("?Number of probed (P)oints is implausible (2 minimum).");
3410
           return;
3402
           return;
3411
         }
3403
         }
3412
       #endif
3404
       #endif
3637
         // Show the Topography map if enabled
3629
         // Show the Topography map if enabled
3638
         if (do_topography_map) {
3630
         if (do_topography_map) {
3639
 
3631
 
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");
3632
+          SERIAL_PROTOCOLLNPGM("\nBed Height Topography:\n"
3633
+                                 "   +--- BACK --+\n"
3634
+                                 "   |           |\n"
3635
+                                 " L |    (+)    | R\n"
3636
+                                 " E |           | I\n"
3637
+                                 " F | (-) N (+) | G\n"
3638
+                                 " T |           | H\n"
3639
+                                 "   |    (-)    | T\n"
3640
+                                 "   |           |\n"
3641
+                                 "   O-- FRONT --+\n"
3642
+                                 " (0,0)");
3651
 
3643
 
3652
           float min_diff = 999;
3644
           float min_diff = 999;
3653
 
3645
 
3674
           } // yy
3666
           } // yy
3675
           SERIAL_EOL;
3667
           SERIAL_EOL;
3676
           if (verbose_level > 3) {
3668
           if (verbose_level > 3) {
3677
-            SERIAL_PROTOCOLPGM(" \nCorrected Bed Height vs. Bed Topology: \n");
3669
+            SERIAL_PROTOCOLLNPGM("\nCorrected Bed Height vs. Bed Topology:");
3678
 
3670
 
3679
             for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) {
3671
             for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) {
3680
               for (int xx = 0; xx < auto_bed_leveling_grid_points; xx++) {
3672
               for (int xx = 0; xx < auto_bed_leveling_grid_points; xx++) {
3703
 
3695
 
3704
     #if DISABLED(DELTA)
3696
     #if DISABLED(DELTA)
3705
       if (verbose_level > 0)
3697
       if (verbose_level > 0)
3706
-        planner.bed_level_matrix.debug(" \n\nBed Level Correction Matrix:");
3698
+        planner.bed_level_matrix.debug("\n\nBed Level Correction Matrix:");
3707
 
3699
 
3708
       if (!dryrun) {
3700
       if (!dryrun) {
3709
         /**
3701
         /**
3747
     #ifdef Z_PROBE_END_SCRIPT
3739
     #ifdef Z_PROBE_END_SCRIPT
3748
       #if ENABLED(DEBUG_LEVELING_FEATURE)
3740
       #if ENABLED(DEBUG_LEVELING_FEATURE)
3749
         if (DEBUGGING(LEVELING)) {
3741
         if (DEBUGGING(LEVELING)) {
3750
-          SERIAL_ECHO("Z Probe End Script: ");
3742
+          SERIAL_ECHOPGM("Z Probe End Script: ");
3751
           SERIAL_ECHOLNPGM(Z_PROBE_END_SCRIPT);
3743
           SERIAL_ECHOLNPGM(Z_PROBE_END_SCRIPT);
3752
         }
3744
         }
3753
       #endif
3745
       #endif
4130
 
4122
 
4131
     int8_t verbose_level = code_seen('V') ? code_value_byte() : 1;
4123
     int8_t verbose_level = code_seen('V') ? code_value_byte() : 1;
4132
     if (verbose_level < 0 || verbose_level > 4) {
4124
     if (verbose_level < 0 || verbose_level > 4) {
4133
-      SERIAL_PROTOCOLPGM("?Verbose Level not plausible (0-4).\n");
4125
+      SERIAL_PROTOCOLLNPGM("?Verbose Level not plausible (0-4).");
4134
       return;
4126
       return;
4135
     }
4127
     }
4136
 
4128
 
4137
     if (verbose_level > 0)
4129
     if (verbose_level > 0)
4138
-      SERIAL_PROTOCOLPGM("M48 Z-Probe Repeatability test\n");
4130
+      SERIAL_PROTOCOLLNPGM("M48 Z-Probe Repeatability test");
4139
 
4131
 
4140
     int8_t n_samples = code_seen('P') ? code_value_byte() : 10;
4132
     int8_t n_samples = code_seen('P') ? code_value_byte() : 10;
4141
     if (n_samples < 4 || n_samples > 50) {
4133
     if (n_samples < 4 || n_samples > 50) {
4142
-      SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n");
4134
+      SERIAL_PROTOCOLLNPGM("?Sample size not plausible (4-50).");
4143
       return;
4135
       return;
4144
     }
4136
     }
4145
 
4137
 
4168
       }
4160
       }
4169
     #else
4161
     #else
4170
       if (sqrt(X_probe_location * X_probe_location + Y_probe_location * Y_probe_location) > DELTA_PROBEABLE_RADIUS) {
4162
       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");
4163
+        SERIAL_PROTOCOLLNPGM("? (X,Y) location outside of probeable radius.");
4172
         return;
4164
         return;
4173
       }
4165
       }
4174
     #endif
4166
     #endif
4176
     bool seen_L = code_seen('L');
4168
     bool seen_L = code_seen('L');
4177
     uint8_t n_legs = seen_L ? code_value_byte() : 0;
4169
     uint8_t n_legs = seen_L ? code_value_byte() : 0;
4178
     if (n_legs > 15) {
4170
     if (n_legs > 15) {
4179
-      SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n");
4171
+      SERIAL_PROTOCOLLNPGM("?Number of legs in movement not plausible (0-15).");
4180
       return;
4172
       return;
4181
     }
4173
     }
4182
     if (n_legs == 1) n_legs = 2;
4174
     if (n_legs == 1) n_legs = 2;
4190
      * we don't want to use that as a starting point for each probe.
4182
      * we don't want to use that as a starting point for each probe.
4191
      */
4183
      */
4192
     if (verbose_level > 2)
4184
     if (verbose_level > 2)
4193
-      SERIAL_PROTOCOLPGM("Positioning the probe...\n");
4185
+      SERIAL_PROTOCOLLNPGM("Positioning the probe...");
4194
 
4186
 
4195
     #if ENABLED(DELTA)
4187
     #if ENABLED(DELTA)
4196
       // we don't do bed level correction in M48 because we want the raw data when we probe
4188
       // we don't do bed level correction in M48 because we want the raw data when we probe
4223
         if (verbose_level > 3) {
4215
         if (verbose_level > 3) {
4224
           SERIAL_ECHOPAIR("Starting radius: ", radius);
4216
           SERIAL_ECHOPAIR("Starting radius: ", radius);
4225
           SERIAL_ECHOPAIR("   angle: ", angle);
4217
           SERIAL_ECHOPAIR("   angle: ", angle);
4226
-          SERIAL_ECHO(" Direction: ");
4227
-          if (dir > 0) SERIAL_ECHO("Counter ");
4228
-          SERIAL_ECHOLN("Clockwise");
4218
+          SERIAL_ECHOPGM(" Direction: ");
4219
+          if (dir > 0) SERIAL_ECHOPGM("Counter-");
4220
+          SERIAL_ECHOLNPGM("Clockwise");
4229
         }
4221
         }
4230
 
4222
 
4231
         for (uint8_t l = 0; l < n_legs - 1; l++) {
4223
         for (uint8_t l = 0; l < n_legs - 1; l++) {
4268
             }
4260
             }
4269
           #endif
4261
           #endif
4270
           if (verbose_level > 3) {
4262
           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]);
4263
+            SERIAL_PROTOCOLPGM("Going to:");
4264
+            SERIAL_ECHOPAIR(" X", X_current);
4265
+            SERIAL_ECHOPAIR(" Y", Y_current);
4266
+            SERIAL_ECHOPAIR(" Z", current_position[Z_AXIS]);
4275
             SERIAL_EOL;
4267
             SERIAL_EOL;
4276
           }
4268
           }
4277
           do_blocking_move_to_xy(X_current, Y_current);
4269
           do_blocking_move_to_xy(X_current, Y_current);
5542
     }
5534
     }
5543
     else if (servo_index >= 0) {
5535
     else if (servo_index >= 0) {
5544
       SERIAL_ECHO_START;
5536
       SERIAL_ECHO_START;
5545
-      SERIAL_ECHO(" Servo ");
5537
+      SERIAL_ECHOPGM(" Servo ");
5546
       SERIAL_ECHO(servo_index);
5538
       SERIAL_ECHO(servo_index);
5547
-      SERIAL_ECHO(": ");
5539
+      SERIAL_ECHOPGM(": ");
5548
       SERIAL_ECHOLN(servo[servo_index].read());
5540
       SERIAL_ECHOLN(servo[servo_index].read());
5549
     }
5541
     }
5550
   }
5542
   }
5601
       thermalManager.updatePID();
5593
       thermalManager.updatePID();
5602
       SERIAL_ECHO_START;
5594
       SERIAL_ECHO_START;
5603
       #if ENABLED(PID_PARAMS_PER_HOTEND)
5595
       #if ENABLED(PID_PARAMS_PER_HOTEND)
5604
-        SERIAL_ECHO(" e:"); // specify extruder in serial output
5596
+        SERIAL_ECHOPGM(" e:"); // specify extruder in serial output
5605
         SERIAL_ECHO(e);
5597
         SERIAL_ECHO(e);
5606
       #endif // PID_PARAMS_PER_HOTEND
5598
       #endif // PID_PARAMS_PER_HOTEND
5607
-      SERIAL_ECHO(" p:");
5599
+      SERIAL_ECHOPGM(" p:");
5608
       SERIAL_ECHO(PID_PARAM(Kp, e));
5600
       SERIAL_ECHO(PID_PARAM(Kp, e));
5609
-      SERIAL_ECHO(" i:");
5601
+      SERIAL_ECHOPGM(" i:");
5610
       SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e)));
5602
       SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e)));
5611
-      SERIAL_ECHO(" d:");
5603
+      SERIAL_ECHOPGM(" d:");
5612
       SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e)));
5604
       SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e)));
5613
       #if ENABLED(PID_ADD_EXTRUSION_RATE)
5605
       #if ENABLED(PID_ADD_EXTRUSION_RATE)
5614
-        SERIAL_ECHO(" c:");
5606
+        SERIAL_ECHOPGM(" c:");
5615
         //Kc does not have scaling applied above, or in resetting defaults
5607
         //Kc does not have scaling applied above, or in resetting defaults
5616
         SERIAL_ECHO(PID_PARAM(Kc, e));
5608
         SERIAL_ECHO(PID_PARAM(Kc, e));
5617
       #endif
5609
       #endif
5635
     thermalManager.updatePID();
5627
     thermalManager.updatePID();
5636
 
5628
 
5637
     SERIAL_ECHO_START;
5629
     SERIAL_ECHO_START;
5638
-    SERIAL_ECHO(" p:");
5630
+    SERIAL_ECHOPGM(" p:");
5639
     SERIAL_ECHO(thermalManager.bedKp);
5631
     SERIAL_ECHO(thermalManager.bedKp);
5640
-    SERIAL_ECHO(" i:");
5632
+    SERIAL_ECHOPGM(" i:");
5641
     SERIAL_ECHO(unscalePID_i(thermalManager.bedKi));
5633
     SERIAL_ECHO(unscalePID_i(thermalManager.bedKi));
5642
-    SERIAL_ECHO(" d:");
5634
+    SERIAL_ECHOPGM(" d:");
5643
     SERIAL_ECHOLN(unscalePID_d(thermalManager.bedKd));
5635
     SERIAL_ECHOLN(unscalePID_d(thermalManager.bedKd));
5644
   }
5636
   }
5645
 
5637
 
5739
 #if ENABLED(SCARA)
5731
 #if ENABLED(SCARA)
5740
   bool SCARA_move_to_cal(uint8_t delta_x, uint8_t delta_y) {
5732
   bool SCARA_move_to_cal(uint8_t delta_x, uint8_t delta_y) {
5741
     //SoftEndsEnabled = false;              // Ignore soft endstops during calibration
5733
     //SoftEndsEnabled = false;              // Ignore soft endstops during calibration
5742
-    //SERIAL_ECHOLN(" Soft endstops disabled ");
5734
+    //SERIAL_ECHOLNPGM(" Soft endstops disabled");
5743
     if (IsRunning()) {
5735
     if (IsRunning()) {
5744
       //gcode_get_destination(); // For X Y Z E F
5736
       //gcode_get_destination(); // For X Y Z E F
5745
       delta[X_AXIS] = delta_x;
5737
       delta[X_AXIS] = delta_x;
5758
    * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
5750
    * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
5759
    */
5751
    */
5760
   inline bool gcode_M360() {
5752
   inline bool gcode_M360() {
5761
-    SERIAL_ECHOLN(" Cal: Theta 0 ");
5753
+    SERIAL_ECHOLNPGM(" Cal: Theta 0");
5762
     return SCARA_move_to_cal(0, 120);
5754
     return SCARA_move_to_cal(0, 120);
5763
   }
5755
   }
5764
 
5756
 
5766
    * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
5758
    * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
5767
    */
5759
    */
5768
   inline bool gcode_M361() {
5760
   inline bool gcode_M361() {
5769
-    SERIAL_ECHOLN(" Cal: Theta 90 ");
5761
+    SERIAL_ECHOLNPGM(" Cal: Theta 90");
5770
     return SCARA_move_to_cal(90, 130);
5762
     return SCARA_move_to_cal(90, 130);
5771
   }
5763
   }
5772
 
5764
 
5774
    * M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration)
5766
    * M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration)
5775
    */
5767
    */
5776
   inline bool gcode_M362() {
5768
   inline bool gcode_M362() {
5777
-    SERIAL_ECHOLN(" Cal: Psi 0 ");
5769
+    SERIAL_ECHOLNPGM(" Cal: Psi 0");
5778
     return SCARA_move_to_cal(60, 180);
5770
     return SCARA_move_to_cal(60, 180);
5779
   }
5771
   }
5780
 
5772
 
5782
    * M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
5774
    * M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
5783
    */
5775
    */
5784
   inline bool gcode_M363() {
5776
   inline bool gcode_M363() {
5785
-    SERIAL_ECHOLN(" Cal: Psi 90 ");
5777
+    SERIAL_ECHOLNPGM(" Cal: Psi 90");
5786
     return SCARA_move_to_cal(50, 90);
5778
     return SCARA_move_to_cal(50, 90);
5787
   }
5779
   }
5788
 
5780
 
5790
    * M364: SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
5782
    * M364: SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
5791
    */
5783
    */
5792
   inline bool gcode_M364() {
5784
   inline bool gcode_M364() {
5793
-    SERIAL_ECHOLN(" Cal: Theta-Psi 90 ");
5785
+    SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90");
5794
     return SCARA_move_to_cal(45, 135);
5786
     return SCARA_move_to_cal(45, 135);
5795
   }
5787
   }
5796
 
5788
 
6109
       else {
6101
       else {
6110
         SERIAL_ECHOPGM(MSG_Z_MIN);
6102
         SERIAL_ECHOPGM(MSG_Z_MIN);
6111
         SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MIN);
6103
         SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MIN);
6104
+        SERIAL_CHAR(' ');
6112
         SERIAL_ECHOPGM(MSG_Z_MAX);
6105
         SERIAL_ECHOPGM(MSG_Z_MAX);
6113
         SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MAX);
6106
         SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MAX);
6114
       }
6107
       }
6625
   #endif
6618
   #endif
6626
 
6619
 
6627
   SERIAL_ECHO_START;
6620
   SERIAL_ECHO_START;
6628
-  SERIAL_ECHO(MSG_ACTIVE_EXTRUDER);
6621
+  SERIAL_ECHOPGM(MSG_ACTIVE_EXTRUDER);
6629
   SERIAL_PROTOCOLLN((int)active_extruder);
6622
   SERIAL_PROTOCOLLN((int)active_extruder);
6630
 }
6623
 }
6631
 
6624
 

+ 20
- 23
Marlin/cardreader.cpp View File

102
       if (!dir.open(parent, lfilename, O_READ)) {
102
       if (!dir.open(parent, lfilename, O_READ)) {
103
         if (lsAction == LS_SerialPrint) {
103
         if (lsAction == LS_SerialPrint) {
104
           SERIAL_ECHO_START;
104
           SERIAL_ECHO_START;
105
-          SERIAL_ECHOLN(MSG_SD_CANT_OPEN_SUBDIR);
105
+          SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR);
106
           SERIAL_ECHOLN(lfilename);
106
           SERIAL_ECHOLN(lfilename);
107
         }
107
         }
108
       }
108
       }
357
     dirname_start = &name[1];
357
     dirname_start = &name[1];
358
     while (dirname_start != NULL) {
358
     while (dirname_start != NULL) {
359
       dirname_end = strchr(dirname_start, '/');
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
       if (dirname_end != NULL && dirname_end > dirname_start) {
362
       if (dirname_end != NULL && dirname_end > dirname_start) {
363
         char subdirname[FILENAME_LENGTH];
363
         char subdirname[FILENAME_LENGTH];
364
         strncpy(subdirname, dirname_start, dirname_end - dirname_start);
364
         strncpy(subdirname, dirname_start, dirname_end - dirname_start);
371
           return;
371
           return;
372
         }
372
         }
373
         else {
373
         else {
374
-          //SERIAL_ECHOLN("dive ok");
374
+          //SERIAL_ECHOLNPGM("dive ok");
375
         }
375
         }
376
 
376
 
377
         curDir = &myDir;
377
         curDir = &myDir;
379
       }
379
       }
380
       else { // the remainder after all /fsa/fdsa/ is the filename
380
       else { // the remainder after all /fsa/fdsa/ is the filename
381
         fname = dirname_start;
381
         fname = dirname_start;
382
-        //SERIAL_ECHOLN("remainder");
382
+        //SERIAL_ECHOLNPGM("remainder");
383
         //SERIAL_ECHOLN(fname);
383
         //SERIAL_ECHOLN(fname);
384
         break;
384
         break;
385
       }
385
       }
392
   if (read) {
392
   if (read) {
393
     if (file.open(curDir, fname, O_READ)) {
393
     if (file.open(curDir, fname, O_READ)) {
394
       filesize = file.fileSize();
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
       sdpos = 0;
398
       sdpos = 0;
400
 
399
 
401
       SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED);
400
       SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED);
403
       lcd_setstatus(longFilename[0] ? longFilename : fname);
402
       lcd_setstatus(longFilename[0] ? longFilename : fname);
404
     }
403
     }
405
     else {
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
   else { //write
410
   else { //write
412
     if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) {
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
     else {
416
     else {
418
       saving = true;
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
       lcd_setstatus(fname);
419
       lcd_setstatus(fname);
422
     }
420
     }
423
   }
421
   }
438
     dirname_start = strchr(name, '/') + 1;
436
     dirname_start = strchr(name, '/') + 1;
439
     while (dirname_start != NULL) {
437
     while (dirname_start != NULL) {
440
       dirname_end = strchr(dirname_start, '/');
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
       if (dirname_end != NULL && dirname_end > dirname_start) {
441
       if (dirname_end != NULL && dirname_end > dirname_start) {
444
         char subdirname[FILENAME_LENGTH];
442
         char subdirname[FILENAME_LENGTH];
445
         strncpy(subdirname, dirname_start, dirname_end - dirname_start);
443
         strncpy(subdirname, dirname_start, dirname_end - dirname_start);
446
         subdirname[dirname_end - dirname_start] = 0;
444
         subdirname[dirname_end - dirname_start] = 0;
447
         SERIAL_ECHOLN(subdirname);
445
         SERIAL_ECHOLN(subdirname);
448
         if (!myDir.open(curDir, subdirname, O_READ)) {
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
           SERIAL_PROTOCOLCHAR('.');
448
           SERIAL_PROTOCOLCHAR('.');
452
           return;
449
           return;
453
         }
450
         }
454
         else {
451
         else {
455
-          //SERIAL_ECHOLN("dive ok");
452
+          //SERIAL_ECHOLNPGM("dive ok");
456
         }
453
         }
457
 
454
 
458
         curDir = &myDir;
455
         curDir = &myDir;
460
       }
457
       }
461
       else { // the remainder after all /fsa/fdsa/ is the filename
458
       else { // the remainder after all /fsa/fdsa/ is the filename
462
         fname = dirname_start;
459
         fname = dirname_start;
463
-        //SERIAL_ECHOLN("remainder");
460
+        //SERIAL_ECHOLNPGM("remainder");
464
         //SERIAL_ECHOLN(fname);
461
         //SERIAL_ECHOLN(fname);
465
         break;
462
         break;
466
       }
463
       }

+ 3
- 3
Marlin/configuration_store.cpp View File

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

+ 1
- 1
Marlin/endstops.cpp View File

197
 } // Endstops::report_state
197
 } // Endstops::report_state
198
 
198
 
199
 void Endstops::M119() {
199
 void Endstops::M119() {
200
-  SERIAL_PROTOCOLLN(MSG_M119_REPORT);
200
+  SERIAL_PROTOCOLLNPGM(MSG_M119_REPORT);
201
   #if HAS_X_MIN
201
   #if HAS_X_MIN
202
     SERIAL_PROTOCOLPGM(MSG_X_MIN);
202
     SERIAL_PROTOCOLPGM(MSG_X_MIN);
203
     SERIAL_PROTOCOLLN(((READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN));
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
 #define MSG_ENDSTOP_OPEN                    "open"
157
 #define MSG_ENDSTOP_OPEN                    "open"
158
 #define MSG_HOTEND_OFFSET                   "Hotend offsets:"
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
 #define MSG_SD_INIT_FAIL                    "SD init fail"
161
 #define MSG_SD_INIT_FAIL                    "SD init fail"
162
 #define MSG_SD_VOL_INIT_FAIL                "volume.init failed"
162
 #define MSG_SD_VOL_INIT_FAIL                "volume.init failed"
163
 #define MSG_SD_OPENROOT_FAIL                "openRoot failed"
163
 #define MSG_SD_OPENROOT_FAIL                "openRoot failed"

+ 1
- 1
Marlin/stepper.cpp View File

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

+ 1
- 1
Marlin/stepper_dac.cpp View File

98
     SERIAL_ECHOPAIR(" (",   dac_amps(2));
98
     SERIAL_ECHOPAIR(" (",   dac_amps(2));
99
     SERIAL_ECHOPAIR(") E:", dac_perc(3));
99
     SERIAL_ECHOPAIR(") E:", dac_perc(3));
100
     SERIAL_ECHOPAIR(" (",   dac_amps(3));
100
     SERIAL_ECHOPAIR(" (",   dac_amps(3));
101
-    SERIAL_ECHOLN(")");
101
+    SERIAL_ECHOLNPGM(")");
102
   }
102
   }
103
 
103
 
104
   void dac_commit_eeprom() {
104
   void dac_commit_eeprom() {

+ 32
- 32
Marlin/temperature.cpp View File

304
               bias = constrain(bias, 20, max_pow - 20);
304
               bias = constrain(bias, 20, max_pow - 20);
305
               d = (bias > max_pow / 2) ? max_pow - 1 - bias : bias;
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
               if (cycles > 2) {
311
               if (cycles > 2) {
312
                 Ku = (4.0 * d) / (3.14159265 * (max - min) / 2.0);
312
                 Ku = (4.0 * d) / (3.14159265 * (max - min) / 2.0);
313
                 Tu = ((float)(t_low + t_high) / 1000.0);
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
                 workKp = 0.6 * Ku;
316
                 workKp = 0.6 * Ku;
317
                 workKi = 2 * workKp / Tu;
317
                 workKi = 2 * workKp / Tu;
318
                 workKd = workKp * Tu / 8;
318
                 workKd = workKp * Tu / 8;
319
                 SERIAL_PROTOCOLLNPGM(MSG_CLASSIC_PID);
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
                 workKp = 0.33*Ku;
324
                 workKp = 0.33*Ku;
325
                 workKi = workKp/Tu;
325
                 workKi = workKp/Tu;
326
                 workKd = workKp*Tu/3;
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
                 workKp = 0.2*Ku;
331
                 workKp = 0.2*Ku;
332
                 workKi = 2*workKp/Tu;
332
                 workKi = 2*workKp/Tu;
333
                 workKd = workKp*Tu/3;
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
 
377
 
378
         #if HAS_PID_FOR_BOTH
378
         #if HAS_PID_FOR_BOTH
379
           const char* estring = hotend < 0 ? "bed" : "";
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
         #elif ENABLED(PIDTEMP)
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
         #else
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
         #endif
391
         #endif
392
 
392
 
393
         #define _SET_BED_PID() \
393
         #define _SET_BED_PID() \
626
 
626
 
627
     #if ENABLED(PID_BED_DEBUG)
627
     #if ENABLED(PID_BED_DEBUG)
628
       SERIAL_ECHO_START;
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
       SERIAL_ECHO(current_temperature_bed);
631
       SERIAL_ECHO(current_temperature_bed);
632
-      SERIAL_ECHO(" Output ");
632
+      SERIAL_ECHOPGM(" Output ");
633
       SERIAL_ECHO(pid_output);
633
       SERIAL_ECHO(pid_output);
634
-      SERIAL_ECHO(" pTerm ");
634
+      SERIAL_ECHOPGM(" pTerm ");
635
       SERIAL_ECHO(pTerm_bed);
635
       SERIAL_ECHO(pTerm_bed);
636
-      SERIAL_ECHO(" iTerm ");
636
+      SERIAL_ECHOPGM(" iTerm ");
637
       SERIAL_ECHO(iTerm_bed);
637
       SERIAL_ECHO(iTerm_bed);
638
-      SERIAL_ECHO(" dTerm ");
638
+      SERIAL_ECHOPGM(" dTerm ");
639
       SERIAL_ECHOLN(dTerm_bed);
639
       SERIAL_ECHOLN(dTerm_bed);
640
     #endif //PID_BED_DEBUG
640
     #endif //PID_BED_DEBUG
641
 
641
 

+ 5
- 8
Marlin/ultralcd.cpp View File

2266
 
2266
 
2267
                 #if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG)
2267
                 #if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG)
2268
                   SERIAL_ECHO_START;
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
                 #endif //ENCODER_RATE_MULTIPLIER_DEBUG
2274
                 #endif //ENCODER_RATE_MULTIPLIER_DEBUG
2278
               }
2275
               }
2279
 
2276
 

Loading…
Cancel
Save