Optimize common strings

Saves 128 bytes in testing with `mftest mega 1 -y`
This commit is contained in:
Scott Lahteine
2019-11-29 04:45:07 -06:00
parent 4d8e7cdb30
commit f83bc0aa13
28 changed files with 272 additions and 172 deletions

View File

@@ -25,11 +25,11 @@
void report_M92(const bool echo=true, const int8_t e=-1) {
if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' ');
SERIAL_ECHOPAIR(" M92 X", LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS]),
" Y", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS]),
" Z", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS]));
SERIAL_ECHOPAIR_P(PSTR(" M92 X"), LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS]),
SP_Y_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS]),
SP_Z_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS]));
#if DISABLED(DISTINCT_E_FACTORS)
SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS]));
SERIAL_ECHOPAIR_P(SP_E_STR, VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS]));
#endif
SERIAL_EOL();
@@ -37,8 +37,8 @@ void report_M92(const bool echo=true, const int8_t e=-1) {
for (uint8_t i = 0; i < E_STEPPERS; i++) {
if (e >= 0 && i != e) continue;
if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' ');
SERIAL_ECHOLNPAIR(" M92 T", (int)i,
" E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS_N(i)]));
SERIAL_ECHOLNPAIR_P(PSTR(" M92 T"), (int)i,
SP_E_STR, VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS_N(i)]));
}
#endif