From ad5e73d772bd0c57525536e9d5c09d7fd93d6334 Mon Sep 17 00:00:00 2001 From: Haxk20 <16738302+Haxk20@users.noreply.github.com> Date: Sat, 12 Sep 2020 02:53:06 +0200 Subject: [PATCH] Fix Print Stats appearance (#19348) --- Marlin/src/lcd/menu/menu_info.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp index 00ab9ad19..864e855df 100644 --- a/Marlin/src/lcd/menu/menu_info.cpp +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -34,6 +34,9 @@ #include "game/game.h" #endif +#define VALUE_ITEM(MSG, VALUE, STYL) do{ char msg[21]; strcpy_P(msg, PSTR(": ")); strcpy(msg + 2, VALUE); STATIC_ITEM(MSG, STYL, msg); }while(0) +#define VALUE_ITEM_P(MSG, PVALUE, STYL) do{ char msg[21]; strcpy_P(msg, PSTR(": ")); strcpy_P(msg + 2, PSTR(PVALUE)); STATIC_ITEM(MSG, STYL, msg); }while(0) + #if ENABLED(PRINTCOUNTER) #include "../../module/printcounter.h" @@ -49,8 +52,8 @@ char buffer[21]; START_SCREEN(); // 12345678901234567890 - STATIC_ITEM(MSG_INFO_PRINT_COUNT, SS_LEFT, i16tostr3left(stats.totalPrints)); // Print Count: 999 - STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS, SS_LEFT, i16tostr3left(stats.finishedPrints)); // Completed : 666 + VALUE_ITEM(MSG_INFO_PRINT_COUNT, i16tostr3left(stats.totalPrints), SS_LEFT); // Print Count: 999 + VALUE_ITEM(MSG_INFO_COMPLETED_PRINTS, i16tostr3left(stats.finishedPrints), SS_LEFT); // Completed : 666 STATIC_ITEM(MSG_INFO_PRINT_TIME, SS_LEFT); // Total print Time: STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.printTime).toString(buffer)); // > 99y 364d 23h 59m 59s