From 05a706dfb636aefc2e0c729c0d1a831721a14636 Mon Sep 17 00:00:00 2001 From: Knutwurst <36196269+knutwurst@users.noreply.github.com> Date: Wed, 24 May 2023 22:38:14 +0200 Subject: [PATCH] Fix print time display. --- Marlin/src/inc/Version.h | 2 +- .../src/lcd/extui/knutwurst/anycubic_touchscreen.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a96dcd37..866cbe5a 100755 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ - #define CUSTOM_BUILD_VERSION "1.5.0-b4" + #define CUSTOM_BUILD_VERSION "1.5.0-b5" #ifndef STRING_DISTRIBUTION_DATE #define STRING_DISTRIBUTION_DATE "2023-05-24" diff --git a/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp b/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp index 89116686..93da6c3f 100755 --- a/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp +++ b/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp @@ -1283,13 +1283,14 @@ break; case 7: // A7 GET PRINTING TIME { + const uint32_t elapsedSeconds = getProgress_seconds_elapsed(); SEND_PGM("A7V "); - if (starttime != 0) { // print time - uint16_t time = millis() / 60000 - starttime / 60000; - SEND(itostr2(time / 60)); + if (elapsedSeconds != 0) { // print time + const uint32_t elapsedMinutes = elapsedSeconds / 60; + SEND(ui8tostr2(elapsedMinutes / 60)); SEND_PGM(" H "); - SEND(itostr2(time % 60)); - SEND_PGM(" M"); + SEND(ui8tostr2(elapsedMinutes % 60)); + SENDLINE_PGM(" M"); } else SENDLINE_PGM(" 999:999");