Optimize common strings
Saves 128 bytes in testing with `mftest mega 1 -y`
This commit is contained in:
@ -560,7 +560,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
ExtUI::onMeshUpdate(meshCount, newz);
|
||||
#endif
|
||||
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Save X", meshCount.x, " Y", meshCount.y, " Z", measured_z + zoffset);
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR_P(PSTR("Save X"), meshCount.x, SP_Y_STR, meshCount.y, SP_Z_STR, measured_z + zoffset);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
@ -362,10 +362,10 @@ void GcodeSuite::G34() {
|
||||
void GcodeSuite::M422() {
|
||||
if (!parser.seen_any()) {
|
||||
for (uint8_t i = 0; i < G34_PROBE_COUNT; ++i)
|
||||
SERIAL_ECHOLNPAIR("M422 S", i + 1, " X", z_auto_align_pos[i].x, " Y", z_auto_align_pos[i].y);
|
||||
SERIAL_ECHOLNPAIR_P(PSTR("M422 S"), i + 1, SP_X_STR, z_auto_align_pos[i].x, SP_Y_STR, z_auto_align_pos[i].y);
|
||||
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
||||
for (uint8_t i = 0; i < Z_STEPPER_COUNT; ++i)
|
||||
SERIAL_ECHOLNPAIR("M422 W", i + 1, " X", z_stepper_pos[i].x, " Y", z_stepper_pos[i].y);
|
||||
SERIAL_ECHOLNPAIR_P(PSTR("M422 W"), i + 1, SP_X_STR, z_stepper_pos[i].x, SP_Y_STR, z_stepper_pos[i].y);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
@ -326,12 +326,12 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
inline void report_measured_center(const measurements_t &m) {
|
||||
SERIAL_ECHOLNPGM("Center:");
|
||||
#if HAS_X_CENTER
|
||||
SERIAL_ECHOLNPAIR(" X", m.obj_center.x);
|
||||
SERIAL_ECHOLNPAIR_P(SP_X_STR, m.obj_center.x);
|
||||
#endif
|
||||
#if HAS_Y_CENTER
|
||||
SERIAL_ECHOLNPAIR(" Y", m.obj_center.y);
|
||||
SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.obj_center.y);
|
||||
#endif
|
||||
SERIAL_ECHOLNPAIR(" Z", m.obj_center.z);
|
||||
SERIAL_ECHOLNPAIR_P(SP_Z_STR, m.obj_center.z);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
@ -358,12 +358,12 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
SERIAL_ECHO(int(active_extruder));
|
||||
SERIAL_ECHOLNPGM(" Positional Error:");
|
||||
#if HAS_X_CENTER
|
||||
SERIAL_ECHOLNPAIR(" X", m.pos_error.x);
|
||||
SERIAL_ECHOLNPAIR_P(SP_X_STR, m.pos_error.x);
|
||||
#endif
|
||||
#if HAS_Y_CENTER
|
||||
SERIAL_ECHOLNPAIR(" Y", m.pos_error.y);
|
||||
SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.pos_error.y);
|
||||
#endif
|
||||
SERIAL_ECHOLNPAIR(" Z", m.pos_error.z);
|
||||
SERIAL_ECHOLNPAIR_P(SP_Z_STR, m.pos_error.z);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
@ -371,10 +371,10 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
SERIAL_ECHOLNPGM("Nozzle Tip Outer Dimensions:");
|
||||
#if HAS_X_CENTER || HAS_Y_CENTER
|
||||
#if HAS_X_CENTER
|
||||
SERIAL_ECHOLNPAIR(" X", m.nozzle_outer_dimension.x);
|
||||
SERIAL_ECHOLNPAIR_P(SP_X_STR, m.nozzle_outer_dimension.x);
|
||||
#endif
|
||||
#if HAS_Y_CENTER
|
||||
SERIAL_ECHOLNPAIR(" Y", m.nozzle_outer_dimension.y);
|
||||
SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.nozzle_outer_dimension.y);
|
||||
#endif
|
||||
#else
|
||||
UNUSED(m);
|
||||
@ -388,7 +388,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
//
|
||||
inline void report_hotend_offsets() {
|
||||
for (uint8_t e = 1; e < HOTENDS; e++)
|
||||
SERIAL_ECHOLNPAIR("T", int(e), " Hotend Offset X", hotend_offset[e].x, " Y", hotend_offset[e].y, " Z", hotend_offset[e].z);
|
||||
SERIAL_ECHOLNPAIR_P(PSTR("T"), int(e), PSTR(" Hotend Offset X"), hotend_offset[e].x, SP_Y_STR, hotend_offset[e].y, SP_Z_STR, hotend_offset[e].z);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -178,12 +178,12 @@ void GcodeSuite::M48() {
|
||||
while (!position_is_reachable_by_probe(next_pos)) {
|
||||
next_pos *= 0.8f;
|
||||
if (verbose_level > 3)
|
||||
SERIAL_ECHOLNPAIR("Moving inward: X", next_pos.x, " Y", next_pos.y);
|
||||
SERIAL_ECHOLNPAIR_P(PSTR("Moving inward: X"), next_pos.x, SP_Y_STR, next_pos.y);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (verbose_level > 3)
|
||||
SERIAL_ECHOLNPAIR("Going to: X", next_pos.x, " Y", next_pos.y);
|
||||
SERIAL_ECHOLNPAIR_P(PSTR("Going to: X"), next_pos.x, SP_Y_STR, next_pos.y);
|
||||
|
||||
do_blocking_move_to_xy(next_pos);
|
||||
} // n_legs loop
|
||||
|
@ -27,18 +27,22 @@
|
||||
#include "../gcode.h"
|
||||
#include "../../module/tool_change.h"
|
||||
|
||||
#include "../../Marlin.h" // for SP_X_STR, etc.
|
||||
|
||||
extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[];
|
||||
|
||||
void M217_report(const bool eeprom=false) {
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
|
||||
serialprintPGM(eeprom ? PSTR(" M217") : PSTR("Toolchange:"));
|
||||
SERIAL_ECHOPAIR(" S", LINEAR_UNIT(toolchange_settings.swap_length));
|
||||
SERIAL_ECHOPAIR(" E", LINEAR_UNIT(toolchange_settings.extra_prime));
|
||||
SERIAL_ECHOPAIR_P(SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime));
|
||||
SERIAL_ECHOPAIR(" P", LINEAR_UNIT(toolchange_settings.prime_speed));
|
||||
SERIAL_ECHOPAIR(" R", LINEAR_UNIT(toolchange_settings.retract_speed));
|
||||
|
||||
#if ENABLED(TOOLCHANGE_PARK)
|
||||
SERIAL_ECHOPAIR(" X", LINEAR_UNIT(toolchange_settings.change_point.x));
|
||||
SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(toolchange_settings.change_point.y));
|
||||
SERIAL_ECHOPAIR_P(SP_X_STR, LINEAR_UNIT(toolchange_settings.change_point.x));
|
||||
SERIAL_ECHOPAIR_P(SP_Y_STR, LINEAR_UNIT(toolchange_settings.change_point.y));
|
||||
#endif
|
||||
|
||||
#else
|
||||
@ -47,7 +51,7 @@ void M217_report(const bool eeprom=false) {
|
||||
|
||||
#endif
|
||||
|
||||
SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(toolchange_settings.z_raise));
|
||||
SERIAL_ECHOPAIR_P(SP_Z_STR, LINEAR_UNIT(toolchange_settings.z_raise));
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
|
@ -331,7 +331,7 @@ void GcodeSuite::M43() {
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
wait_for_user = true;
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), PSTR("Continue"));
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), CONTINUE_STR);
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("M43 Wait Called"));
|
||||
|
@ -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
|
||||
|
||||
|
@ -35,7 +35,7 @@ inline void echo_mix() {
|
||||
|
||||
inline void echo_zt(const int t, const float &z) {
|
||||
mixer.update_mix_from_vtool(t);
|
||||
SERIAL_ECHOPAIR(" Z", z, " T", t);
|
||||
SERIAL_ECHOPAIR_P(SP_Z_STR, z, PSTR(" T"), t);
|
||||
echo_mix();
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ void GcodeSuite::M0_M1() {
|
||||
wait_for_user = true;
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M0/1 Break Called"), PSTR("Continue"));
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M0/1 Break Called"), CONTINUE_STR);
|
||||
#endif
|
||||
|
||||
if (ms > 0) {
|
||||
|
@ -103,12 +103,17 @@ void GcodeSuite::M290() {
|
||||
|
||||
#if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
||||
{
|
||||
SERIAL_ECHOLNPAIR("Hotend ", int(active_extruder), "Offset"
|
||||
#error "Hey!"
|
||||
SERIAL_ECHOLNPAIR_P(
|
||||
PSTR("Hotend "), int(active_extruder)
|
||||
#if ENABLED(BABYSTEP_XY)
|
||||
" X", hotend_offset[active_extruder].x,
|
||||
" Y", hotend_offset[active_extruder].y,
|
||||
, PSTR("Offset X"), hotend_offset[active_extruder].x
|
||||
, SP_Y_STR, hotend_offset[active_extruder].y
|
||||
, SP_Z_STR
|
||||
#else
|
||||
, PSTR("Offset Z")
|
||||
#endif
|
||||
" Z", hotend_offset[active_extruder].z
|
||||
, hotend_offset[active_extruder].z
|
||||
);
|
||||
}
|
||||
#endif
|
||||
@ -119,12 +124,15 @@ void GcodeSuite::M290() {
|
||||
|
||||
#if ENABLED(BABYSTEP_DISPLAY_TOTAL)
|
||||
{
|
||||
SERIAL_ECHOLNPAIR("Babystep"
|
||||
SERIAL_ECHOLNPAIR_P(
|
||||
#if ENABLED(BABYSTEP_XY)
|
||||
" X", babystep.axis_total[X_AXIS],
|
||||
" Y", babystep.axis_total[Y_AXIS],
|
||||
PSTR("Babystep X"), babystep.axis_total[X_AXIS]
|
||||
, SP_Y_STR, babystep.axis_total[Y_AXIS]
|
||||
, SP_Z_STR
|
||||
#else
|
||||
, PSTR("Babystep Z")
|
||||
#endif
|
||||
" Z", babystep.axis_total[BS_TODO_AXIS(Z_AXIS)]
|
||||
, babystep.axis_total[BS_TODO_AXIS(Z_AXIS)]
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include "../../feature/bedlevel/bedlevel.h"
|
||||
#include "../../module/probe.h"
|
||||
|
||||
extern const char SP_Y_STR[], SP_Z_STR[];
|
||||
|
||||
/**
|
||||
* M851: Set the nozzle-to-probe offsets in current units
|
||||
*/
|
||||
@ -35,7 +37,7 @@ void GcodeSuite::M851() {
|
||||
|
||||
// Show usage with no parameters
|
||||
if (!parser.seen("XYZ")) {
|
||||
SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET " X", probe_offset.x, " Y", probe_offset.y, " Z", probe_offset.z);
|
||||
SERIAL_ECHOLNPAIR_P(PSTR(MSG_PROBE_OFFSET " X"), probe_offset.x, SP_Y_STR, probe_offset.y, SP_Z_STR, probe_offset.z);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user