From d4669dbf6af9519ae5b553605e7a26a774c6a512 Mon Sep 17 00:00:00 2001 From: Speaka <48431623+Speaka@users.noreply.github.com> Date: Tue, 27 Oct 2020 23:25:01 +0100 Subject: [PATCH] Fix G35 PROGMEM strings (#19926) --- Marlin/src/gcode/bedlevel/G35.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index f6ae2db2c7..b39a7b9ed8 100755 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -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();