diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index 6b91371170f6..721d27211b88 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -276,13 +276,13 @@ class SString : public MString { SString& set() { super::set(); return *this; } template - SString& setf_P(PGM_P const fmt, Args... more) { snprintf_P(str, SIZE, fmt, more...); debug(F("setf_P")); return *this; } + SString& setf_P(PGM_P const fmt, Args... more) { super::setf_P(fmt, more...); return *this; } template - SString& setf(const char *fmt, Args... more) { snprintf(str, SIZE, fmt, more...); debug(F("setf")); return *this; } + SString& setf(const char *fmt, Args... more) { super::setf(fmt, more...); return *this; } template - SString& setf(FSTR_P const fmt, Args... more) { return setf_P(FTOP(fmt), more...); } + SString& setf(FSTR_P const fmt, Args... more) { super::setf(fmt, more...); return *this; } template SString& set(const T &v) { super::set(v); return *this; } diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index dc2e1761adbc..701d2ae97a54 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -376,11 +376,19 @@ void _lcd_ubl_storage_mesh() { * UBL LCD "radar" map point editing */ void _lcd_ubl_map_edit_cmd() { - char ubl_lcd_gcode[50], str[10], str2[10]; - dtostrf(bedlevel.get_mesh_x(x_plot), 0, 2, str); - dtostrf(bedlevel.get_mesh_y(y_plot), 0, 2, str2); - snprintf_P(ubl_lcd_gcode, sizeof(ubl_lcd_gcode), PSTR("G29P4X%sY%sR%i"), str, str2, int(n_edit_pts)); - queue.inject(ubl_lcd_gcode); + #if ENABLED(POWER_LOSS_RECOVERY) + // Costs 198 bytes on AVR with PLR disabled, but saves 60 bytes with PLR enabled + queue.inject(TS(F("G29P4X"), x_plot, 'Y', y_plot, 'R', n_edit_pts)); + #else + char ubl_lcd_gcode[50], str1[10], str2[10]; + snprintf_P(ubl_lcd_gcode, sizeof(ubl_lcd_gcode), + PSTR("G29P4X%sY%sR%i"), + dtostrf(bedlevel.get_mesh_x(x_plot), 0, 2, str1), + dtostrf(bedlevel.get_mesh_y(y_plot), 0, 2, str2), + int(n_edit_pts) + ); + queue.inject(ubl_lcd_gcode); + #endif } /**