Fix G35 PROGMEM strings (#19926)

This commit is contained in:
Speaka 2020-10-27 23:25:01 +01:00 committed by Scott Lahteine
parent f43f71646e
commit d4669dbf6a

View File

@ -129,15 +129,19 @@ void GcodeSuite::G35() {
const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[i], PROBE_PT_RAISE, 0, true);
if (isnan(z_probed_height)) {
SERIAL_ECHOPAIR("G35 failed at point ", int(i), " (", tramming_point_name[i], ")");
SERIAL_ECHOPAIR("G35 failed at point ", int(i), " (");
SERIAL_ECHOPGM_P((char *)pgm_read_ptr(&tramming_point_name[i]));
SERIAL_CHAR(')');
SERIAL_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y);
err_break = true;
break;
}
if (DEBUGGING(LEVELING)) {
DEBUG_ECHOPAIR("Probing point ", int(i), " (", tramming_point_name[i], ")");
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);
DEBUG_ECHOPAIR("Probing point ", int(i), " (");
DEBUG_PRINT_P((char *)pgm_read_ptr(&tramming_point_name[i]));
DEBUG_CHAR(')');
DEBUG_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);
}
z_measured[i] = z_probed_height;
@ -155,9 +159,9 @@ void GcodeSuite::G35() {
const float decimal_part = adjust - float(full_turns);
const int minutes = trunc(decimal_part * 60.0f);
SERIAL_ECHOPAIR("Turn ", tramming_point_name[i],
" ", (screw_thread & 1) == (adjust > 0) ? "CCW" : "CW",
" by ", abs(full_turns), " turns");
SERIAL_ECHOPGM("Turn ");
SERIAL_ECHOPGM_P((char *)pgm_read_ptr(&tramming_point_name[i]));
SERIAL_ECHOPAIR(" ", (screw_thread & 1) == (adjust > 0) ? "CCW" : "CW", " by ", abs(full_turns), " turns");
if (minutes) SERIAL_ECHOPAIR(" and ", abs(minutes), " minutes");
if (ENABLED(REPORT_TRAMMING_MM)) SERIAL_ECHOPAIR(" (", -diff, "mm)");
SERIAL_EOL();