From 9f706a9635ff4b87593c2f0fec2bd6a680fa6c21 Mon Sep 17 00:00:00 2001 From: Kai Date: Tue, 30 Aug 2016 08:13:32 +0200 Subject: [PATCH] Patch duration_t toDigital method --- Marlin/duration_t.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Marlin/duration_t.h b/Marlin/duration_t.h index 8e08791ff1..dffb832545 100644 --- a/Marlin/duration_t.h +++ b/Marlin/duration_t.h @@ -146,11 +146,12 @@ struct duration_t { * 11d 12:33 */ void toDigital(char *buffer, bool with_days=false) const { - int m = this->minute() % 60; + uint16_t h = uint16_t(this->hour() % 24UL), + m = uint16_t(this->minute() % 60UL); if (with_days) - sprintf_P(buffer, PSTR("%id %02i:%02i"), this->day(), this->hour() % 24, m); + sprintf_P(buffer, PSTR("%ud %02u:%02u"), this->day(), h, m); else - sprintf_P(buffer, PSTR("%02i:%02i"), this->hour(), m); + sprintf_P(buffer, PSTR("%02u:%02u"), h, m); } };