From f44766838797586d907ef7e9fa84eeff71f2b160 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 23 Jan 2018 18:58:10 -0600 Subject: [PATCH] Optimize some serial strings --- Marlin/I2CPositionEncoder.cpp | 2 +- Marlin/Marlin_main.cpp | 2 +- Marlin/configuration_store.cpp | 8 ++++---- Marlin/gcode.cpp | 2 +- Marlin/printcounter.cpp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/I2CPositionEncoder.cpp b/Marlin/I2CPositionEncoder.cpp index 84334812f7..6422b4f2fc 100644 --- a/Marlin/I2CPositionEncoder.cpp +++ b/Marlin/I2CPositionEncoder.cpp @@ -117,7 +117,7 @@ SERIAL_ECHOPGM("New position reads as "); SERIAL_ECHO(get_position()); - SERIAL_ECHOPGM("("); + SERIAL_CHAR('('); SERIAL_ECHO(mm_from_count(get_position())); SERIAL_ECHOLNPGM(")"); #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b3d9bf3360..135832c018 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -10029,7 +10029,7 @@ inline void gcode_M502() { if (!ijk) { SERIAL_ECHO_START(); - SERIAL_ECHO(MSG_SKEW_FACTOR " XY: "); + SERIAL_ECHOPGM(MSG_SKEW_FACTOR " XY: "); SERIAL_ECHO_F(planner.xy_skew_factor, 6); SERIAL_EOL(); #if ENABLED(SKEW_CORRECTION_FOR_Z) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 9fc000a535..2d3d5fbd93 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -2228,7 +2228,7 @@ void MarlinSettings::reset() { } CONFIG_ECHO_START; #if ENABLED(SKEW_CORRECTION_FOR_Z) - SERIAL_ECHO(" M852 I"); + SERIAL_ECHOPGM(" M852 I"); SERIAL_ECHO_F(LINEAR_UNIT(planner.xy_skew_factor), 6); SERIAL_ECHOPGM(" J"); SERIAL_ECHO_F(LINEAR_UNIT(planner.xz_skew_factor), 6); @@ -2236,7 +2236,7 @@ void MarlinSettings::reset() { SERIAL_ECHO_F(LINEAR_UNIT(planner.yz_skew_factor), 6); SERIAL_EOL(); #else - SERIAL_ECHO(" M852 S"); + SERIAL_ECHOPGM(" M852 S"); SERIAL_ECHO_F(LINEAR_UNIT(planner.xy_skew_factor), 6); SERIAL_EOL(); #endif @@ -2251,7 +2251,7 @@ void MarlinSettings::reset() { SERIAL_ECHOLNPGM("Stepper driver current:"); } CONFIG_ECHO_START; - SERIAL_ECHO(" M906"); + SERIAL_ECHOPGM(" M906"); #if ENABLED(X_IS_TMC2130) || ENABLED(X_IS_TMC2208) SERIAL_ECHOPAIR(" X ", stepperX.getCurrent()); #endif @@ -2297,7 +2297,7 @@ void MarlinSettings::reset() { SERIAL_ECHOLNPGM("Sensorless homing threshold:"); } CONFIG_ECHO_START; - SERIAL_ECHO(" M914"); + SERIAL_ECHOPGM(" M914"); #if ENABLED(X_IS_TMC2130) SERIAL_ECHOPAIR(" X", stepperX.sgt()); #endif diff --git a/Marlin/gcode.cpp b/Marlin/gcode.cpp index fd26aaea16..0fdd2bc9c2 100644 --- a/Marlin/gcode.cpp +++ b/Marlin/gcode.cpp @@ -282,7 +282,7 @@ void GCodeParser::unknown_command_error() { #else SERIAL_ECHOPAIR(" args: \"", command_args); #endif - SERIAL_ECHOPGM("\""); + SERIAL_CHAR('"'); if (string_arg) { SERIAL_ECHOPGM(" string: \""); SERIAL_ECHO(string_arg); diff --git a/Marlin/printcounter.cpp b/Marlin/printcounter.cpp index 6edc0ac8cc..794a1995ef 100644 --- a/Marlin/printcounter.cpp +++ b/Marlin/printcounter.cpp @@ -140,7 +140,7 @@ void PrintCounter::showStats() { SERIAL_ECHOPGM("Filament used: "); SERIAL_ECHO(this->data.filamentUsed / 1000); - SERIAL_ECHOPGM("m"); + SERIAL_CHAR('m'); SERIAL_EOL(); }