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
     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;

+ 75
- 83
Marlin/Marlin_main.cpp View File

1442
 static void set_axis_is_at_home(AxisEnum axis) {
1442
 static void set_axis_is_at_home(AxisEnum axis) {
1443
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1443
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1444
     if (DEBUGGING(LEVELING)) {
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
   #endif
1448
   #endif
1449
 
1449
 
1993
       long start_steps = stepper.position(Z_AXIS);
1993
       long start_steps = stepper.position(Z_AXIS);
1994
 
1994
 
1995
       #if ENABLED(DEBUG_LEVELING_FEATURE)
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
       #endif
1997
       #endif
1998
 
1998
 
1999
       // move down slowly until you find the bed
1999
       // move down slowly until you find the bed
2015
         if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe (DELTA) 2", current_position);
2015
         if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe (DELTA) 2", current_position);
2016
       #endif
2016
       #endif
2017
 
2017
 
2018
-      SYNC_PLAN_POSITION_KINEMATIC();
2019
-
2020
     #else // !DELTA
2018
     #else // !DELTA
2021
 
2019
 
2022
       #if ENABLED(AUTO_BED_LEVELING_FEATURE)
2020
       #if ENABLED(AUTO_BED_LEVELING_FEATURE)
2054
       // Get the current stepper position after bumping an endstop
2052
       // Get the current stepper position after bumping an endstop
2055
       current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS);
2053
       current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS);
2056
 
2054
 
2057
-      SYNC_PLAN_POSITION_KINEMATIC();
2058
-
2059
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2055
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2060
         if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe", current_position);
2056
         if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe", current_position);
2061
       #endif
2057
       #endif
2062
 
2058
 
2063
     #endif // !DELTA
2059
     #endif // !DELTA
2064
 
2060
 
2061
+    SYNC_PLAN_POSITION_KINEMATIC();
2062
+
2065
     feedrate = old_feedrate;
2063
     feedrate = old_feedrate;
2066
 
2064
 
2067
     return current_position[Z_AXIS];
2065
     return current_position[Z_AXIS];
2083
   static float probe_pt(float x, float y, bool stow = true, int verbose_level = 1) {
2081
   static float probe_pt(float x, float y, bool stow = true, int verbose_level = 1) {
2084
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2082
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2085
       if (DEBUGGING(LEVELING)) {
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
         DEBUG_POS("", current_position);
2088
         DEBUG_POS("", current_position);
2090
       }
2089
       }
2091
     #endif
2090
     #endif
2107
     do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER));
2106
     do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER));
2108
 
2107
 
2109
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2108
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2110
-      if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> deploy_z_probe");
2109
+      if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
2111
     #endif
2110
     #endif
2112
     deploy_z_probe();
2111
     deploy_z_probe();
2113
 
2112
 
2115
 
2114
 
2116
     if (stow) {
2115
     if (stow) {
2117
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2116
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2118
-        if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> stow_z_probe");
2117
+        if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
2119
       #endif
2118
       #endif
2120
       stow_z_probe();
2119
       stow_z_probe();
2121
     }
2120
     }
2329
     #if HAS_BED_PROBE
2328
     #if HAS_BED_PROBE
2330
       if (axis == Z_AXIS && axis_home_dir < 0) {
2329
       if (axis == Z_AXIS && axis_home_dir < 0) {
2331
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2330
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2332
-          if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" > deploy_z_probe()");
2331
+          if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
2333
         #endif
2332
         #endif
2334
         deploy_z_probe();
2333
         deploy_z_probe();
2335
       }
2334
       }
2453
     #if HAS_BED_PROBE
2452
     #if HAS_BED_PROBE
2454
       if (axis == Z_AXIS && axis_home_dir < 0) {
2453
       if (axis == Z_AXIS && axis_home_dir < 0) {
2455
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2454
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2456
-          if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" > stow_z_probe()");
2455
+          if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
2457
         #endif
2456
         #endif
2458
         stow_z_probe();
2457
         stow_z_probe();
2459
       }
2458
       }
2543
   SERIAL_ECHO_START;
2542
   SERIAL_ECHO_START;
2544
   SERIAL_ECHOPGM(MSG_UNKNOWN_COMMAND);
2543
   SERIAL_ECHOPGM(MSG_UNKNOWN_COMMAND);
2545
   SERIAL_ECHO(current_command);
2544
   SERIAL_ECHO(current_command);
2546
-  SERIAL_ECHOPGM("\"\n");
2545
+  SERIAL_ECHOLNPGM("\"");
2547
 }
2546
 }
2548
 
2547
 
2549
 #if ENABLED(HOST_KEEPALIVE_FEATURE)
2548
 #if ENABLED(HOST_KEEPALIVE_FEATURE)
2741
 inline void gcode_G28() {
2740
 inline void gcode_G28() {
2742
 
2741
 
2743
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2742
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2744
-    if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("gcode_G28 >>>");
2743
+    if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(">>> gcode_G28");
2745
   #endif
2744
   #endif
2746
 
2745
 
2747
   // Wait for planner moves to finish!
2746
   // Wait for planner moves to finish!
3187
     switch (state) {
3186
     switch (state) {
3188
       case MeshReport:
3187
       case MeshReport:
3189
         if (mbl.has_mesh()) {
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
           SERIAL_PROTOCOLLNPGM("\nMeasured points:");
3194
           SERIAL_PROTOCOLLNPGM("\nMeasured points:");
3204
           for (py = 0; py < MESH_NUM_Y_POINTS; py++) {
3195
           for (py = 0; py < MESH_NUM_Y_POINTS; py++) {
3205
             for (px = 0; px < MESH_NUM_X_POINTS; px++) {
3196
             for (px = 0; px < MESH_NUM_X_POINTS; px++) {
3268
         if (code_seen('X')) {
3259
         if (code_seen('X')) {
3269
           px = code_value_int() - 1;
3260
           px = code_value_int() - 1;
3270
           if (px < 0 || px >= MESH_NUM_X_POINTS) {
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
             return;
3263
             return;
3273
           }
3264
           }
3274
         }
3265
         }
3275
         else {
3266
         else {
3276
-          SERIAL_PROTOCOLPGM("X not entered.\n");
3267
+          SERIAL_PROTOCOLLNPGM("X not entered.");
3277
           return;
3268
           return;
3278
         }
3269
         }
3279
         if (code_seen('Y')) {
3270
         if (code_seen('Y')) {
3280
           py = code_value_int() - 1;
3271
           py = code_value_int() - 1;
3281
           if (py < 0 || py >= MESH_NUM_Y_POINTS) {
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
             return;
3274
             return;
3284
           }
3275
           }
3285
         }
3276
         }
3286
         else {
3277
         else {
3287
-          SERIAL_PROTOCOLPGM("Y not entered.\n");
3278
+          SERIAL_PROTOCOLLNPGM("Y not entered.");
3288
           return;
3279
           return;
3289
         }
3280
         }
3290
         if (code_seen('Z')) {
3281
         if (code_seen('Z')) {
3291
           z = code_value_axis_units(Z_AXIS);
3282
           z = code_value_axis_units(Z_AXIS);
3292
         }
3283
         }
3293
         else {
3284
         else {
3294
-          SERIAL_PROTOCOLPGM("Z not entered.\n");
3285
+          SERIAL_PROTOCOLLNPGM("Z not entered.");
3295
           return;
3286
           return;
3296
         }
3287
         }
3297
         mbl.z_values[py][px] = z;
3288
         mbl.z_values[py][px] = z;
3302
           z = code_value_axis_units(Z_AXIS);
3293
           z = code_value_axis_units(Z_AXIS);
3303
         }
3294
         }
3304
         else {
3295
         else {
3305
-          SERIAL_PROTOCOLPGM("Z not entered.\n");
3296
+          SERIAL_PROTOCOLLNPGM("Z not entered.");
3306
           return;
3297
           return;
3307
         }
3298
         }
3308
         mbl.z_offset = z;
3299
         mbl.z_offset = z;
3368
 
3359
 
3369
     #if ENABLED(DEBUG_LEVELING_FEATURE)
3360
     #if ENABLED(DEBUG_LEVELING_FEATURE)
3370
       if (DEBUGGING(LEVELING)) {
3361
       if (DEBUGGING(LEVELING)) {
3371
-        SERIAL_ECHOLNPGM("gcode_G29 >>>");
3362
+        SERIAL_ECHOLNPGM(">>> gcode_G29");
3372
         DEBUG_POS("", current_position);
3363
         DEBUG_POS("", current_position);
3373
       }
3364
       }
3374
     #endif
3365
     #endif
3397
       #endif
3388
       #endif
3398
 
3389
 
3399
       if (verbose_level > 0) {
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
       int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS;
3395
       int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS;
3406
       #if DISABLED(DELTA)
3397
       #if DISABLED(DELTA)
3407
         if (code_seen('P')) auto_bed_leveling_grid_points = code_value_int();
3398
         if (code_seen('P')) auto_bed_leveling_grid_points = code_value_int();
3408
         if (auto_bed_leveling_grid_points < 2) {
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
           return;
3401
           return;
3411
         }
3402
         }
3412
       #endif
3403
       #endif
3637
         // Show the Topography map if enabled
3628
         // Show the Topography map if enabled
3638
         if (do_topography_map) {
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
           float min_diff = 999;
3643
           float min_diff = 999;
3653
 
3644
 
3674
           } // yy
3665
           } // yy
3675
           SERIAL_EOL;
3666
           SERIAL_EOL;
3676
           if (verbose_level > 3) {
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
             for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) {
3670
             for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) {
3680
               for (int xx = 0; xx < auto_bed_leveling_grid_points; xx++) {
3671
               for (int xx = 0; xx < auto_bed_leveling_grid_points; xx++) {
3703
 
3694
 
3704
     #if DISABLED(DELTA)
3695
     #if DISABLED(DELTA)
3705
       if (verbose_level > 0)
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
       if (!dryrun) {
3699
       if (!dryrun) {
3709
         /**
3700
         /**
3747
     #ifdef Z_PROBE_END_SCRIPT
3738
     #ifdef Z_PROBE_END_SCRIPT
3748
       #if ENABLED(DEBUG_LEVELING_FEATURE)
3739
       #if ENABLED(DEBUG_LEVELING_FEATURE)
3749
         if (DEBUGGING(LEVELING)) {
3740
         if (DEBUGGING(LEVELING)) {
3750
-          SERIAL_ECHO("Z Probe End Script: ");
3741
+          SERIAL_ECHOPGM("Z Probe End Script: ");
3751
           SERIAL_ECHOLNPGM(Z_PROBE_END_SCRIPT);
3742
           SERIAL_ECHOLNPGM(Z_PROBE_END_SCRIPT);
3752
         }
3743
         }
3753
       #endif
3744
       #endif
4130
 
4121
 
4131
     int8_t verbose_level = code_seen('V') ? code_value_byte() : 1;
4122
     int8_t verbose_level = code_seen('V') ? code_value_byte() : 1;
4132
     if (verbose_level < 0 || verbose_level > 4) {
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
       return;
4125
       return;
4135
     }
4126
     }
4136
 
4127
 
4137
     if (verbose_level > 0)
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
     int8_t n_samples = code_seen('P') ? code_value_byte() : 10;
4131
     int8_t n_samples = code_seen('P') ? code_value_byte() : 10;
4141
     if (n_samples < 4 || n_samples > 50) {
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
       return;
4134
       return;
4144
     }
4135
     }
4145
 
4136
 
4168
       }
4159
       }
4169
     #else
4160
     #else
4170
       if (sqrt(X_probe_location * X_probe_location + Y_probe_location * Y_probe_location) > DELTA_PROBEABLE_RADIUS) {
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
         return;
4163
         return;
4173
       }
4164
       }
4174
     #endif
4165
     #endif
4176
     bool seen_L = code_seen('L');
4167
     bool seen_L = code_seen('L');
4177
     uint8_t n_legs = seen_L ? code_value_byte() : 0;
4168
     uint8_t n_legs = seen_L ? code_value_byte() : 0;
4178
     if (n_legs > 15) {
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
       return;
4171
       return;
4181
     }
4172
     }
4182
     if (n_legs == 1) n_legs = 2;
4173
     if (n_legs == 1) n_legs = 2;
4190
      * we don't want to use that as a starting point for each probe.
4181
      * we don't want to use that as a starting point for each probe.
4191
      */
4182
      */
4192
     if (verbose_level > 2)
4183
     if (verbose_level > 2)
4193
-      SERIAL_PROTOCOLPGM("Positioning the probe...\n");
4184
+      SERIAL_PROTOCOLLNPGM("Positioning the probe...");
4194
 
4185
 
4195
     #if ENABLED(DELTA)
4186
     #if ENABLED(DELTA)
4196
       // we don't do bed level correction in M48 because we want the raw data when we probe
4187
       // we don't do bed level correction in M48 because we want the raw data when we probe
4223
         if (verbose_level > 3) {
4214
         if (verbose_level > 3) {
4224
           SERIAL_ECHOPAIR("Starting radius: ", radius);
4215
           SERIAL_ECHOPAIR("Starting radius: ", radius);
4225
           SERIAL_ECHOPAIR("   angle: ", angle);
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
         for (uint8_t l = 0; l < n_legs - 1; l++) {
4222
         for (uint8_t l = 0; l < n_legs - 1; l++) {
4268
             }
4259
             }
4269
           #endif
4260
           #endif
4270
           if (verbose_level > 3) {
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
             SERIAL_EOL;
4266
             SERIAL_EOL;
4276
           }
4267
           }
4277
           do_blocking_move_to_xy(X_current, Y_current);
4268
           do_blocking_move_to_xy(X_current, Y_current);
5542
     }
5533
     }
5543
     else if (servo_index >= 0) {
5534
     else if (servo_index >= 0) {
5544
       SERIAL_ECHO_START;
5535
       SERIAL_ECHO_START;
5545
-      SERIAL_ECHO(" Servo ");
5536
+      SERIAL_ECHOPGM(" Servo ");
5546
       SERIAL_ECHO(servo_index);
5537
       SERIAL_ECHO(servo_index);
5547
-      SERIAL_ECHO(": ");
5538
+      SERIAL_ECHOPGM(": ");
5548
       SERIAL_ECHOLN(servo[servo_index].read());
5539
       SERIAL_ECHOLN(servo[servo_index].read());
5549
     }
5540
     }
5550
   }
5541
   }
5601
       thermalManager.updatePID();
5592
       thermalManager.updatePID();
5602
       SERIAL_ECHO_START;
5593
       SERIAL_ECHO_START;
5603
       #if ENABLED(PID_PARAMS_PER_HOTEND)
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
         SERIAL_ECHO(e);
5596
         SERIAL_ECHO(e);
5606
       #endif // PID_PARAMS_PER_HOTEND
5597
       #endif // PID_PARAMS_PER_HOTEND
5607
-      SERIAL_ECHO(" p:");
5598
+      SERIAL_ECHOPGM(" p:");
5608
       SERIAL_ECHO(PID_PARAM(Kp, e));
5599
       SERIAL_ECHO(PID_PARAM(Kp, e));
5609
-      SERIAL_ECHO(" i:");
5600
+      SERIAL_ECHOPGM(" i:");
5610
       SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e)));
5601
       SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e)));
5611
-      SERIAL_ECHO(" d:");
5602
+      SERIAL_ECHOPGM(" d:");
5612
       SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e)));
5603
       SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e)));
5613
       #if ENABLED(PID_ADD_EXTRUSION_RATE)
5604
       #if ENABLED(PID_ADD_EXTRUSION_RATE)
5614
-        SERIAL_ECHO(" c:");
5605
+        SERIAL_ECHOPGM(" c:");
5615
         //Kc does not have scaling applied above, or in resetting defaults
5606
         //Kc does not have scaling applied above, or in resetting defaults
5616
         SERIAL_ECHO(PID_PARAM(Kc, e));
5607
         SERIAL_ECHO(PID_PARAM(Kc, e));
5617
       #endif
5608
       #endif
5635
     thermalManager.updatePID();
5626
     thermalManager.updatePID();
5636
 
5627
 
5637
     SERIAL_ECHO_START;
5628
     SERIAL_ECHO_START;
5638
-    SERIAL_ECHO(" p:");
5629
+    SERIAL_ECHOPGM(" p:");
5639
     SERIAL_ECHO(thermalManager.bedKp);
5630
     SERIAL_ECHO(thermalManager.bedKp);
5640
-    SERIAL_ECHO(" i:");
5631
+    SERIAL_ECHOPGM(" i:");
5641
     SERIAL_ECHO(unscalePID_i(thermalManager.bedKi));
5632
     SERIAL_ECHO(unscalePID_i(thermalManager.bedKi));
5642
-    SERIAL_ECHO(" d:");
5633
+    SERIAL_ECHOPGM(" d:");
5643
     SERIAL_ECHOLN(unscalePID_d(thermalManager.bedKd));
5634
     SERIAL_ECHOLN(unscalePID_d(thermalManager.bedKd));
5644
   }
5635
   }
5645
 
5636
 
5739
 #if ENABLED(SCARA)
5730
 #if ENABLED(SCARA)
5740
   bool SCARA_move_to_cal(uint8_t delta_x, uint8_t delta_y) {
5731
   bool SCARA_move_to_cal(uint8_t delta_x, uint8_t delta_y) {
5741
     //SoftEndsEnabled = false;              // Ignore soft endstops during calibration
5732
     //SoftEndsEnabled = false;              // Ignore soft endstops during calibration
5742
-    //SERIAL_ECHOLN(" Soft endstops disabled ");
5733
+    //SERIAL_ECHOLNPGM(" Soft endstops disabled");
5743
     if (IsRunning()) {
5734
     if (IsRunning()) {
5744
       //gcode_get_destination(); // For X Y Z E F
5735
       //gcode_get_destination(); // For X Y Z E F
5745
       delta[X_AXIS] = delta_x;
5736
       delta[X_AXIS] = delta_x;
5758
    * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
5749
    * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
5759
    */
5750
    */
5760
   inline bool gcode_M360() {
5751
   inline bool gcode_M360() {
5761
-    SERIAL_ECHOLN(" Cal: Theta 0 ");
5752
+    SERIAL_ECHOLNPGM(" Cal: Theta 0");
5762
     return SCARA_move_to_cal(0, 120);
5753
     return SCARA_move_to_cal(0, 120);
5763
   }
5754
   }
5764
 
5755
 
5766
    * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
5757
    * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
5767
    */
5758
    */
5768
   inline bool gcode_M361() {
5759
   inline bool gcode_M361() {
5769
-    SERIAL_ECHOLN(" Cal: Theta 90 ");
5760
+    SERIAL_ECHOLNPGM(" Cal: Theta 90");
5770
     return SCARA_move_to_cal(90, 130);
5761
     return SCARA_move_to_cal(90, 130);
5771
   }
5762
   }
5772
 
5763
 
5774
    * M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration)
5765
    * M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration)
5775
    */
5766
    */
5776
   inline bool gcode_M362() {
5767
   inline bool gcode_M362() {
5777
-    SERIAL_ECHOLN(" Cal: Psi 0 ");
5768
+    SERIAL_ECHOLNPGM(" Cal: Psi 0");
5778
     return SCARA_move_to_cal(60, 180);
5769
     return SCARA_move_to_cal(60, 180);
5779
   }
5770
   }
5780
 
5771
 
5782
    * M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
5773
    * M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
5783
    */
5774
    */
5784
   inline bool gcode_M363() {
5775
   inline bool gcode_M363() {
5785
-    SERIAL_ECHOLN(" Cal: Psi 90 ");
5776
+    SERIAL_ECHOLNPGM(" Cal: Psi 90");
5786
     return SCARA_move_to_cal(50, 90);
5777
     return SCARA_move_to_cal(50, 90);
5787
   }
5778
   }
5788
 
5779
 
5790
    * M364: SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
5781
    * M364: SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
5791
    */
5782
    */
5792
   inline bool gcode_M364() {
5783
   inline bool gcode_M364() {
5793
-    SERIAL_ECHOLN(" Cal: Theta-Psi 90 ");
5784
+    SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90");
5794
     return SCARA_move_to_cal(45, 135);
5785
     return SCARA_move_to_cal(45, 135);
5795
   }
5786
   }
5796
 
5787
 
6109
       else {
6100
       else {
6110
         SERIAL_ECHOPGM(MSG_Z_MIN);
6101
         SERIAL_ECHOPGM(MSG_Z_MIN);
6111
         SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MIN);
6102
         SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MIN);
6103
+        SERIAL_CHAR(' ');
6112
         SERIAL_ECHOPGM(MSG_Z_MAX);
6104
         SERIAL_ECHOPGM(MSG_Z_MAX);
6113
         SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MAX);
6105
         SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MAX);
6114
       }
6106
       }
6625
   #endif
6617
   #endif
6626
 
6618
 
6627
   SERIAL_ECHO_START;
6619
   SERIAL_ECHO_START;
6628
-  SERIAL_ECHO(MSG_ACTIVE_EXTRUDER);
6620
+  SERIAL_ECHOPGM(MSG_ACTIVE_EXTRUDER);
6629
   SERIAL_PROTOCOLLN((int)active_extruder);
6621
   SERIAL_PROTOCOLLN((int)active_extruder);
6630
 }
6622
 }
6631
 
6623
 

+ 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
       }

+ 5
- 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_ECHOPAIR("Version: [", ver);
348
+  //  SERIAL_ECHOPAIR("] Stored version: [", stored_ver);
349
+  //  SERIAL_ECHOLNPGM("]");
348
 
350
 
349
   if (strncmp(ver, stored_ver, 3) != 0) {
351
   if (strncmp(ver, stored_ver, 3) != 0) {
350
     Config_ResetDefault();
352
     Config_ResetDefault();
717
 
719
 
718
   CONFIG_ECHO_START;
720
   CONFIG_ECHO_START;
719
   if (!forReplay) {
721
   if (!forReplay) {
720
-    SERIAL_ECHOLNPGM("Home offset (mm):");
722
+    SERIAL_ECHOLNPGM("Home offset (mm)");
721
     CONFIG_ECHO_START;
723
     CONFIG_ECHO_START;
722
   }
724
   }
723
   SERIAL_ECHOPAIR("  M206 X", home_offset[X_AXIS]);
725
   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");
885
       SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries");
884
       CONFIG_ECHO_START;
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
     SERIAL_EOL;
889
     SERIAL_EOL;
888
 
890
 
889
   #endif // FWRETRACT
891
   #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

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