From c6859a1e54ce7957a234df86ff49039085f3eecb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 1 Sep 2016 23:54:48 -0500 Subject: [PATCH] Handle hours >= 100 --- Marlin/duration_t.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/duration_t.h b/Marlin/duration_t.h index dffb832545..926fc1360d 100644 --- a/Marlin/duration_t.h +++ b/Marlin/duration_t.h @@ -146,12 +146,14 @@ struct duration_t { * 11d 12:33 */ void toDigital(char *buffer, bool with_days=false) const { - uint16_t h = uint16_t(this->hour() % 24UL), + uint16_t h = uint16_t(this->hour()), m = uint16_t(this->minute() % 60UL); if (with_days) sprintf_P(buffer, PSTR("%ud %02u:%02u"), this->day(), h, m); + else if (h < 100) + sprintf_P(buffer, PSTR("%02u:%02u"), h % 24, m); else - sprintf_P(buffer, PSTR("%02u:%02u"), h, m); + sprintf_P(buffer, PSTR("%u:%02u"), h, m); } };