Fix print time display.

This commit is contained in:
Knutwurst
2023-05-24 22:38:14 +02:00
parent 7cc485ae3e
commit 05a706dfb6
2 changed files with 7 additions and 6 deletions

View File

@@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release * here we define this default string as the date where the latest release
* version was tagged. * version was tagged.
*/ */
#define CUSTOM_BUILD_VERSION "1.5.0-b4" #define CUSTOM_BUILD_VERSION "1.5.0-b5"
#ifndef STRING_DISTRIBUTION_DATE #ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2023-05-24" #define STRING_DISTRIBUTION_DATE "2023-05-24"

View File

@@ -1283,13 +1283,14 @@
break; break;
case 7: // A7 GET PRINTING TIME case 7: // A7 GET PRINTING TIME
{ {
const uint32_t elapsedSeconds = getProgress_seconds_elapsed();
SEND_PGM("A7V "); SEND_PGM("A7V ");
if (starttime != 0) { // print time if (elapsedSeconds != 0) { // print time
uint16_t time = millis() / 60000 - starttime / 60000; const uint32_t elapsedMinutes = elapsedSeconds / 60;
SEND(itostr2(time / 60)); SEND(ui8tostr2(elapsedMinutes / 60));
SEND_PGM(" H "); SEND_PGM(" H ");
SEND(itostr2(time % 60)); SEND(ui8tostr2(elapsedMinutes % 60));
SEND_PGM(" M"); SENDLINE_PGM(" M");
} }
else else
SENDLINE_PGM(" 999:999"); SENDLINE_PGM(" 999:999");