diff --git a/Marlin/src/gcode/calibrate/M48.cpp b/Marlin/src/gcode/calibrate/M48.cpp index 910395e561..981a1d9877 100644 --- a/Marlin/src/gcode/calibrate/M48.cpp +++ b/Marlin/src/gcode/calibrate/M48.cpp @@ -261,7 +261,19 @@ void GcodeSuite::M48() { #if HAS_STATUS_MESSAGE // Display M48 results in the status bar - ui.set_status_and_level(MString<30>(GET_TEXT_F(MSG_M48_DEVIATION), F(": "), w_float_t(sigma, 2, 6))); + if (MAX_MESSAGE_SIZE <= 20) { + // 12345678901234567890 + // Deviation: 0.123456 + ui.set_status_and_level(TS(GET_TEXT_F(MSG_M48_DEVIATION), F(": "), w_float_t(sigma, 2, 6))); + } else if (MAX_MESSAGE_SIZE <= 30) { + // 123456789012345678901234567890 + // Dev:0.12345, Max delta:0.12345 + ui.set_status_and_level(TS(GET_TEXT_F(MSG_M48_DEV), ':', w_float_t(sigma, 2, 5), F(", "), GET_TEXT(MSG_M48_MAX_DELTA), ':', w_float_t(_MAX(mean - min, max - mean), 2, 5))); + } else { + // 1234567890123456789012345678901234567890 + // Deviation: 1.23456, Max delta: 1.23456 + ui.set_status_and_level(TS(GET_TEXT_F(MSG_M48_DEVIATION), F(": "), w_float_t(sigma, 2, 6), F(", "), GET_TEXT(MSG_M48_MAX_DELTA), F(": "), w_float_t(_MAX(mean - min, max - mean), 2, 6))); + } #endif } diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 571f85e8ce..54740c923e 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -222,7 +222,9 @@ namespace LanguageNarrow_en { LSTR MSG_M48_TEST = _UxGT("M48 Probe Test"); LSTR MSG_M48_POINT = _UxGT("M48 Point"); LSTR MSG_M48_OUT_OF_BOUNDS = _UxGT("Probe out of bounds"); + LSTR MSG_M48_DEV = _UxGT("Dev"); LSTR MSG_M48_DEVIATION = _UxGT("Deviation"); + LSTR MSG_M48_MAX_DELTA = _UxGT("Max delta"); LSTR MSG_IDEX_MENU = _UxGT("IDEX Mode"); LSTR MSG_OFFSETS_MENU = _UxGT("Tool Offsets"); LSTR MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Park");