Reduce string duplication

This commit is contained in:
Scott Lahteine 2020-06-27 23:27:28 -05:00
parent 0fad9535d1
commit dc6d8357a6
9 changed files with 23 additions and 23 deletions

View file

@ -216,6 +216,7 @@ PGMSTR(M24_STR, "M24");
PGMSTR(SP_P_STR, " P"); PGMSTR(SP_T_STR, " T"); PGMSTR(SP_P_STR, " P"); PGMSTR(SP_T_STR, " T");
PGMSTR(X_STR, "X"); PGMSTR(Y_STR, "Y"); PGMSTR(Z_STR, "Z"); PGMSTR(E_STR, "E"); PGMSTR(X_STR, "X"); PGMSTR(Y_STR, "Y"); PGMSTR(Z_STR, "Z"); PGMSTR(E_STR, "E");
PGMSTR(X_LBL, "X:"); PGMSTR(Y_LBL, "Y:"); PGMSTR(Z_LBL, "Z:"); PGMSTR(E_LBL, "E:"); PGMSTR(X_LBL, "X:"); PGMSTR(Y_LBL, "Y:"); PGMSTR(Z_LBL, "Z:"); PGMSTR(E_LBL, "E:");
PGMSTR(SP_A_STR, " A"); PGMSTR(SP_B_STR, " B"); PGMSTR(SP_C_STR, " C");
PGMSTR(SP_X_STR, " X"); PGMSTR(SP_Y_STR, " Y"); PGMSTR(SP_Z_STR, " Z"); PGMSTR(SP_E_STR, " E"); PGMSTR(SP_X_STR, " X"); PGMSTR(SP_Y_STR, " Y"); PGMSTR(SP_Z_STR, " Z"); PGMSTR(SP_E_STR, " E");
PGMSTR(SP_X_LBL, " X:"); PGMSTR(SP_Y_LBL, " Y:"); PGMSTR(SP_Z_LBL, " Z:"); PGMSTR(SP_E_LBL, " E:"); PGMSTR(SP_X_LBL, " X:"); PGMSTR(SP_Y_LBL, " Y:"); PGMSTR(SP_Z_LBL, " Z:"); PGMSTR(SP_E_LBL, " E:");

View file

@ -120,5 +120,6 @@ void protected_pin_err();
#endif #endif
extern const char NUL_STR[], M112_KILL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[], extern const char NUL_STR[], M112_KILL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[],
SP_A_STR[], SP_B_STR[], SP_C_STR[],
SP_P_STR[], SP_T_STR[], SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[], SP_P_STR[], SP_T_STR[], SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[],
X_LBL[], Y_LBL[], Z_LBL[], E_LBL[], SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_E_LBL[]; X_LBL[], Y_LBL[], Z_LBL[], E_LBL[], SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_E_LBL[];

View file

@ -127,18 +127,16 @@ void GcodeSuite::G35() {
const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[i], PROBE_PT_RAISE, 0, true); const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[i], PROBE_PT_RAISE, 0, true);
if (isnan(z_probed_height)) { if (isnan(z_probed_height)) {
SERIAL_ECHOLNPAIR("G35 failed at point ", int(i), " (", tramming_point_name[i], ")" SERIAL_ECHOPAIR("G35 failed at point ", int(i), " (", tramming_point_name[i], ")");
" X", screws_tilt_adjust_pos[i].x, SERIAL_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y);
" Y", screws_tilt_adjust_pos[i].y);
err_break = true; err_break = true;
break; break;
} }
if (DEBUGGING(LEVELING)) if (DEBUGGING(LEVELING)) {
DEBUG_ECHOLNPAIR("Probing point ", int(i), " (", tramming_point_name[i], ")" DEBUG_ECHOPAIR("Probing point ", int(i), " (", tramming_point_name[i], ")");
" X", screws_tilt_adjust_pos[i].x, SERIAL_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y, SP_Z_STR, z_probed_height);
" Y", screws_tilt_adjust_pos[i].y, }
" Z", z_probed_height);
z_measured[i] = z_probed_height; z_measured[i] = z_probed_height;
} }

View file

@ -39,9 +39,9 @@ void M217_report(const bool eeprom=false) {
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP) #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
serialprintPGM(eeprom ? PSTR(" M217") : PSTR("Toolchange:")); serialprintPGM(eeprom ? PSTR(" M217") : PSTR("Toolchange:"));
SERIAL_ECHOPAIR(" S", LINEAR_UNIT(toolchange_settings.swap_length), SERIAL_ECHOPAIR(" S", LINEAR_UNIT(toolchange_settings.swap_length));
" B", LINEAR_UNIT(toolchange_settings.extra_resume)); SERIAL_ECHOPAIR_P(SP_B_STR, LINEAR_UNIT(toolchange_settings.extra_resume),
SERIAL_ECHOPAIR_P(SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime), SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime),
SP_P_STR, LINEAR_UNIT(toolchange_settings.prime_speed)); SP_P_STR, LINEAR_UNIT(toolchange_settings.prime_speed));
SERIAL_ECHOPAIR(" R", LINEAR_UNIT(toolchange_settings.retract_speed), SERIAL_ECHOPAIR(" R", LINEAR_UNIT(toolchange_settings.retract_speed),
" U", LINEAR_UNIT(toolchange_settings.unretract_speed), " U", LINEAR_UNIT(toolchange_settings.unretract_speed),

View file

@ -289,8 +289,8 @@ void GCodeQueue::ok_to_send() {
while (NUMERIC_SIGNED(*p)) while (NUMERIC_SIGNED(*p))
SERIAL_ECHO(*p++); SERIAL_ECHO(*p++);
} }
SERIAL_ECHOPAIR_P(SP_P_STR, int(planner.moves_free())); SERIAL_ECHOPAIR_P(SP_P_STR, int(planner.moves_free()),
SERIAL_ECHOPAIR(" B", int(BUFSIZE - length)); SP_B_STR, int(BUFSIZE - length));
#endif #endif
SERIAL_EOL(); SERIAL_EOL();
} }

View file

@ -3163,16 +3163,16 @@ void MarlinSettings::reset() {
CONFIG_ECHO_HEADING("Material heatup parameters:"); CONFIG_ECHO_HEADING("Material heatup parameters:");
LOOP_L_N(i, PREHEAT_COUNT) { LOOP_L_N(i, PREHEAT_COUNT) {
CONFIG_ECHO_START(); CONFIG_ECHO_START();
SERIAL_ECHOLNPAIR( SERIAL_ECHOLNPAIR_P(
" M145 S", (int)i PSTR(" M145 S"), (int)i
#if HAS_HOTEND #if HAS_HOTEND
, " H", TEMP_UNIT(ui.material_preset[i].hotend_temp) , PSTR(" H"), TEMP_UNIT(ui.material_preset[i].hotend_temp)
#endif #endif
#if HAS_HEATED_BED #if HAS_HEATED_BED
, " B", TEMP_UNIT(ui.material_preset[i].bed_temp) , SP_B_STR, TEMP_UNIT(ui.material_preset[i].bed_temp)
#endif #endif
#if HAS_FAN #if HAS_FAN
, " F", ui.material_preset[i].fan_speed , PSTR(" F"), ui.material_preset[i].fan_speed
#endif #endif
); );
} }
@ -3198,7 +3198,7 @@ void MarlinSettings::reset() {
, PSTR(" D"), unscalePID_d(PID_PARAM(Kd, e)) , PSTR(" D"), unscalePID_d(PID_PARAM(Kd, e))
); );
#if ENABLED(PID_EXTRUSION_SCALING) #if ENABLED(PID_EXTRUSION_SCALING)
SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, e)); SERIAL_ECHOPAIR_P(SP_C_STR, PID_PARAM(Kc, e));
if (e == 0) SERIAL_ECHOPAIR(" L", thermalManager.lpq_len); if (e == 0) SERIAL_ECHOPAIR(" L", thermalManager.lpq_len);
#endif #endif
#if ENABLED(PID_FAN_SCALING) #if ENABLED(PID_FAN_SCALING)

View file

@ -122,7 +122,7 @@ void recalc_delta_settings() {
#define DELTA_DEBUG(VAR) do { \ #define DELTA_DEBUG(VAR) do { \
SERIAL_ECHOLNPAIR_P(PSTR("Cartesian X"), VAR.x, SP_Y_STR, VAR.y, SP_Z_STR, VAR.z); \ SERIAL_ECHOLNPAIR_P(PSTR("Cartesian X"), VAR.x, SP_Y_STR, VAR.y, SP_Z_STR, VAR.z); \
SERIAL_ECHOLNPAIR("Delta A", delta.a, " B", delta.b, " C", delta.c); \ SERIAL_ECHOLNPAIR_P(PSTR("Delta A"), delta.a, SP_B_STR, delta.b, SP_C_STR, delta.c); \
}while(0) }while(0)
void inverse_kinematics(const xyz_pos_t &raw) { void inverse_kinematics(const xyz_pos_t &raw) {

View file

@ -1281,8 +1281,8 @@ void Temperature::manage_heater() {
SERIAL_ECHOPAIR_F(" R", t.series_res, 1); SERIAL_ECHOPAIR_F(" R", t.series_res, 1);
SERIAL_ECHOPAIR_F_P(SP_T_STR, t.res_25, 1); SERIAL_ECHOPAIR_F_P(SP_T_STR, t.res_25, 1);
SERIAL_ECHOPAIR_F(" B", t.beta, 1); SERIAL_ECHOPAIR_F_P(SP_B_STR, t.beta, 1);
SERIAL_ECHOPAIR_F(" C", t.sh_c_coeff, 9); SERIAL_ECHOPAIR_F_P(SP_C_STR, t.sh_c_coeff, 9);
SERIAL_ECHOPGM(" ; "); SERIAL_ECHOPGM(" ; ");
serialprintPGM( serialprintPGM(
TERN_(HEATER_0_USER_THERMISTOR, t_index == CTI_HOTEND_0 ? PSTR("HOTEND 0") :) TERN_(HEATER_0_USER_THERMISTOR, t_index == CTI_HOTEND_0 ? PSTR("HOTEND 0") :)