瀏覽代碼

Optimize some serial strings

Scott Lahteine 6 年之前
父節點
當前提交
1dcfe193ac

+ 1
- 1
Marlin/src/feature/I2CPositionEncoder.cpp 查看文件

@@ -116,7 +116,7 @@ void I2CPositionEncoder::update() {
116 116
 
117 117
           SERIAL_ECHOPGM("New position reads as ");
118 118
           SERIAL_ECHO(get_position());
119
-          SERIAL_ECHOPGM("(");
119
+          SERIAL_CHAR('(');
120 120
           SERIAL_ECHO(mm_from_count(get_position()));
121 121
           SERIAL_ECHOLNPGM(")");
122 122
         #endif

+ 4
- 4
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp 查看文件

@@ -1732,7 +1732,7 @@
1732 1732
           d = t + normal.z * z1;
1733 1733
           SERIAL_ECHOPGM("D from 1st point: ");
1734 1734
           SERIAL_ECHO_F(d, 6);
1735
-          SERIAL_ECHO("   Z error: ");
1735
+          SERIAL_ECHOPGM("   Z error: ");
1736 1736
           SERIAL_ECHO_F(normal.z*z1-get_z_correction(UBL_PROBE_PT_1_X, UBL_PROBE_PT_1_Y),6);
1737 1737
           SERIAL_EOL();
1738 1738
 
@@ -1741,7 +1741,7 @@
1741 1741
           SERIAL_EOL();
1742 1742
           SERIAL_ECHOPGM("D from 2nd point: ");
1743 1743
           SERIAL_ECHO_F(d, 6);
1744
-          SERIAL_ECHO("   Z error: ");
1744
+          SERIAL_ECHOPGM("   Z error: ");
1745 1745
           SERIAL_ECHO_F(normal.z*z2-get_z_correction(UBL_PROBE_PT_2_X, UBL_PROBE_PT_2_Y),6);
1746 1746
           SERIAL_EOL();
1747 1747
 
@@ -1749,7 +1749,7 @@
1749 1749
           d = t + normal.z * z3;
1750 1750
           SERIAL_ECHOPGM("D from 3rd point: ");
1751 1751
           SERIAL_ECHO_F(d, 6);
1752
-          SERIAL_ECHO("   Z error: ");
1752
+          SERIAL_ECHOPGM("   Z error: ");
1753 1753
           SERIAL_ECHO_F(normal.z*z3-get_z_correction(UBL_PROBE_PT_3_X, UBL_PROBE_PT_3_Y),6);
1754 1754
           SERIAL_EOL();
1755 1755
 
@@ -1766,7 +1766,7 @@
1766 1766
 
1767 1767
           SERIAL_ECHOPAIR("   Z error: (", Z_SAFE_HOMING_X_POINT );
1768 1768
           SERIAL_ECHOPAIR(",", Z_SAFE_HOMING_Y_POINT );
1769
-          SERIAL_ECHO(") = ");
1769
+          SERIAL_ECHOPGM(") = ");
1770 1770
           SERIAL_ECHO_F( get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT),6);
1771 1771
           SERIAL_EOL();
1772 1772
 */

+ 1
- 1
Marlin/src/gcode/calibrate/M852.cpp 查看文件

@@ -93,7 +93,7 @@ void GcodeSuite::M852() {
93 93
 
94 94
   if (!ijk) {
95 95
     SERIAL_ECHO_START();
96
-    SERIAL_ECHO(MSG_SKEW_FACTOR " XY: ");
96
+    SERIAL_ECHOPGM(MSG_SKEW_FACTOR " XY: ");
97 97
     SERIAL_ECHO_F(planner.xy_skew_factor, 6);
98 98
     SERIAL_EOL();
99 99
     #if ENABLED(SKEW_CORRECTION_FOR_Z)

+ 2
- 2
Marlin/src/gcode/parser.cpp 查看文件

@@ -286,13 +286,13 @@ void GCodeParser::unknown_command_error() {
286 286
     SERIAL_ECHO(codenum);
287 287
     SERIAL_ECHOLNPGM(")");
288 288
     #if ENABLED(FASTER_GCODE_PARSER)
289
-      SERIAL_ECHO(" args: \"");
289
+      SERIAL_ECHOPGM(" args: \"");
290 290
       for (char c = 'A'; c <= 'Z'; ++c)
291 291
         if (seen(c)) { SERIAL_CHAR(c); SERIAL_CHAR(' '); }
292 292
     #else
293 293
       SERIAL_ECHOPAIR(" args: \"", command_args);
294 294
     #endif
295
-    SERIAL_ECHOPGM("\"");
295
+    SERIAL_CHAR('"');
296 296
     if (string_arg) {
297 297
       SERIAL_ECHOPGM(" string: \"");
298 298
       SERIAL_ECHO(string_arg);

+ 4
- 4
Marlin/src/module/configuration_store.cpp 查看文件

@@ -2266,7 +2266,7 @@ void MarlinSettings::reset(
2266 2266
       }
2267 2267
       CONFIG_ECHO_START;
2268 2268
       #if ENABLED(SKEW_CORRECTION_FOR_Z)
2269
-        SERIAL_ECHO_P(port, "  M852 I");
2269
+        SERIAL_ECHOPGM_P(port, "  M852 I");
2270 2270
         SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.xy_skew_factor), 6);
2271 2271
         SERIAL_ECHOPGM_P(port, " J");
2272 2272
         SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.xz_skew_factor), 6);
@@ -2274,7 +2274,7 @@ void MarlinSettings::reset(
2274 2274
         SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.yz_skew_factor), 6);
2275 2275
         SERIAL_EOL_P(port);
2276 2276
        #else
2277
-        SERIAL_ECHO_P(port, "  M852 S");
2277
+        SERIAL_ECHOPGM_P(port, "  M852 S");
2278 2278
         SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.xy_skew_factor), 6);
2279 2279
         SERIAL_EOL_P(port);
2280 2280
       #endif
@@ -2289,7 +2289,7 @@ void MarlinSettings::reset(
2289 2289
         SERIAL_ECHOLNPGM_P(port, "Stepper driver current:");
2290 2290
       }
2291 2291
       CONFIG_ECHO_START;
2292
-      SERIAL_ECHO_P(port, "  M906");
2292
+      SERIAL_ECHOPGM_P(port, "  M906");
2293 2293
       #if ENABLED(X_IS_TMC2130) || ENABLED(X_IS_TMC2208)
2294 2294
         SERIAL_ECHOPAIR_P(port, " X ", stepperX.getCurrent());
2295 2295
       #endif
@@ -2335,7 +2335,7 @@ void MarlinSettings::reset(
2335 2335
         SERIAL_ECHOLNPGM_P(port, "Sensorless homing threshold:");
2336 2336
       }
2337 2337
       CONFIG_ECHO_START;
2338
-      SERIAL_ECHO_P(port, "  M914");
2338
+      SERIAL_ECHOPGM_P(port, "  M914");
2339 2339
       #if ENABLED(X_IS_TMC2130)
2340 2340
         SERIAL_ECHOPAIR_P(port, " X", stepperX.sgt());
2341 2341
       #endif

+ 1
- 1
Marlin/src/module/printcounter.cpp 查看文件

@@ -144,7 +144,7 @@ void PrintCounter::showStats() {
144 144
 
145 145
   SERIAL_ECHOPGM("Filament used: ");
146 146
   SERIAL_ECHO(this->data.filamentUsed / 1000);
147
-  SERIAL_ECHOPGM("m");
147
+  SERIAL_CHAR('m');
148 148
 
149 149
   SERIAL_EOL();
150 150
 }

Loading…
取消
儲存