Optimize some serial strings

2.0.x
Scott Lahteine 7 years ago
parent 9644fe1839
commit 1dcfe193ac

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

@ -1732,7 +1732,7 @@
d = t + normal.z * z1; d = t + normal.z * z1;
SERIAL_ECHOPGM("D from 1st point: "); SERIAL_ECHOPGM("D from 1st point: ");
SERIAL_ECHO_F(d, 6); SERIAL_ECHO_F(d, 6);
SERIAL_ECHO(" Z error: "); SERIAL_ECHOPGM(" Z error: ");
SERIAL_ECHO_F(normal.z*z1-get_z_correction(UBL_PROBE_PT_1_X, UBL_PROBE_PT_1_Y),6); SERIAL_ECHO_F(normal.z*z1-get_z_correction(UBL_PROBE_PT_1_X, UBL_PROBE_PT_1_Y),6);
SERIAL_EOL(); SERIAL_EOL();
@ -1741,7 +1741,7 @@
SERIAL_EOL(); SERIAL_EOL();
SERIAL_ECHOPGM("D from 2nd point: "); SERIAL_ECHOPGM("D from 2nd point: ");
SERIAL_ECHO_F(d, 6); SERIAL_ECHO_F(d, 6);
SERIAL_ECHO(" Z error: "); SERIAL_ECHOPGM(" Z error: ");
SERIAL_ECHO_F(normal.z*z2-get_z_correction(UBL_PROBE_PT_2_X, UBL_PROBE_PT_2_Y),6); SERIAL_ECHO_F(normal.z*z2-get_z_correction(UBL_PROBE_PT_2_X, UBL_PROBE_PT_2_Y),6);
SERIAL_EOL(); SERIAL_EOL();
@ -1749,7 +1749,7 @@
d = t + normal.z * z3; d = t + normal.z * z3;
SERIAL_ECHOPGM("D from 3rd point: "); SERIAL_ECHOPGM("D from 3rd point: ");
SERIAL_ECHO_F(d, 6); SERIAL_ECHO_F(d, 6);
SERIAL_ECHO(" Z error: "); SERIAL_ECHOPGM(" Z error: ");
SERIAL_ECHO_F(normal.z*z3-get_z_correction(UBL_PROBE_PT_3_X, UBL_PROBE_PT_3_Y),6); SERIAL_ECHO_F(normal.z*z3-get_z_correction(UBL_PROBE_PT_3_X, UBL_PROBE_PT_3_Y),6);
SERIAL_EOL(); SERIAL_EOL();
@ -1766,7 +1766,7 @@
SERIAL_ECHOPAIR(" Z error: (", Z_SAFE_HOMING_X_POINT ); SERIAL_ECHOPAIR(" Z error: (", Z_SAFE_HOMING_X_POINT );
SERIAL_ECHOPAIR(",", Z_SAFE_HOMING_Y_POINT ); SERIAL_ECHOPAIR(",", Z_SAFE_HOMING_Y_POINT );
SERIAL_ECHO(") = "); SERIAL_ECHOPGM(") = ");
SERIAL_ECHO_F( get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT),6); SERIAL_ECHO_F( get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT),6);
SERIAL_EOL(); SERIAL_EOL();
*/ */

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

@ -286,13 +286,13 @@ void GCodeParser::unknown_command_error() {
SERIAL_ECHO(codenum); SERIAL_ECHO(codenum);
SERIAL_ECHOLNPGM(")"); SERIAL_ECHOLNPGM(")");
#if ENABLED(FASTER_GCODE_PARSER) #if ENABLED(FASTER_GCODE_PARSER)
SERIAL_ECHO(" args: \""); SERIAL_ECHOPGM(" args: \"");
for (char c = 'A'; c <= 'Z'; ++c) for (char c = 'A'; c <= 'Z'; ++c)
if (seen(c)) { SERIAL_CHAR(c); SERIAL_CHAR(' '); } if (seen(c)) { SERIAL_CHAR(c); SERIAL_CHAR(' '); }
#else #else
SERIAL_ECHOPAIR(" args: \"", command_args); SERIAL_ECHOPAIR(" args: \"", command_args);
#endif #endif
SERIAL_ECHOPGM("\""); SERIAL_CHAR('"');
if (string_arg) { if (string_arg) {
SERIAL_ECHOPGM(" string: \""); SERIAL_ECHOPGM(" string: \"");
SERIAL_ECHO(string_arg); SERIAL_ECHO(string_arg);

@ -2266,7 +2266,7 @@ void MarlinSettings::reset(
} }
CONFIG_ECHO_START; CONFIG_ECHO_START;
#if ENABLED(SKEW_CORRECTION_FOR_Z) #if ENABLED(SKEW_CORRECTION_FOR_Z)
SERIAL_ECHO_P(port, " M852 I"); SERIAL_ECHOPGM_P(port, " M852 I");
SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.xy_skew_factor), 6); SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.xy_skew_factor), 6);
SERIAL_ECHOPGM_P(port, " J"); SERIAL_ECHOPGM_P(port, " J");
SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.xz_skew_factor), 6); SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.xz_skew_factor), 6);
@ -2274,7 +2274,7 @@ void MarlinSettings::reset(
SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.yz_skew_factor), 6); SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.yz_skew_factor), 6);
SERIAL_EOL_P(port); SERIAL_EOL_P(port);
#else #else
SERIAL_ECHO_P(port, " M852 S"); SERIAL_ECHOPGM_P(port, " M852 S");
SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.xy_skew_factor), 6); SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.xy_skew_factor), 6);
SERIAL_EOL_P(port); SERIAL_EOL_P(port);
#endif #endif
@ -2289,7 +2289,7 @@ void MarlinSettings::reset(
SERIAL_ECHOLNPGM_P(port, "Stepper driver current:"); SERIAL_ECHOLNPGM_P(port, "Stepper driver current:");
} }
CONFIG_ECHO_START; CONFIG_ECHO_START;
SERIAL_ECHO_P(port, " M906"); SERIAL_ECHOPGM_P(port, " M906");
#if ENABLED(X_IS_TMC2130) || ENABLED(X_IS_TMC2208) #if ENABLED(X_IS_TMC2130) || ENABLED(X_IS_TMC2208)
SERIAL_ECHOPAIR_P(port, " X ", stepperX.getCurrent()); SERIAL_ECHOPAIR_P(port, " X ", stepperX.getCurrent());
#endif #endif
@ -2335,7 +2335,7 @@ void MarlinSettings::reset(
SERIAL_ECHOLNPGM_P(port, "Sensorless homing threshold:"); SERIAL_ECHOLNPGM_P(port, "Sensorless homing threshold:");
} }
CONFIG_ECHO_START; CONFIG_ECHO_START;
SERIAL_ECHO_P(port, " M914"); SERIAL_ECHOPGM_P(port, " M914");
#if ENABLED(X_IS_TMC2130) #if ENABLED(X_IS_TMC2130)
SERIAL_ECHOPAIR_P(port, " X", stepperX.sgt()); SERIAL_ECHOPAIR_P(port, " X", stepperX.sgt());
#endif #endif

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

Loading…
Cancel
Save