mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] console_countdown: width to of countdown to 4 digits
@ 2017-03-09 17:05 Oleksij Rempel
  2017-03-09 17:05 ` [PATCH 2/3] console_countdown: add possibility to abort countdown by external commands Oleksij Rempel
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Oleksij Rempel @ 2017-03-09 17:05 UTC (permalink / raw)
  To: barebox

From: Marc Kleine-Budde <mkl@pengutronix.de>

This patch increases the displayed width of the countdown to 4 digits,
otherwise waiting for more then 99 seconds doesn't look good.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 common/console_countdown.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/console_countdown.c b/common/console_countdown.c
index c0c8c9502..b2eec72b2 100644
--- a/common/console_countdown.c
+++ b/common/console_countdown.c
@@ -35,7 +35,7 @@ int console_countdown(int timeout_s, unsigned flags, char *out_key)
 	countdown = timeout_s;
 
 	if (!(flags & CONSOLE_COUNTDOWN_SILENT))
-		printf("%2d", countdown--);
+		printf("%4d", countdown--);
 
 	do {
 		if (tstc()) {
@@ -50,7 +50,7 @@ int console_countdown(int timeout_s, unsigned flags, char *out_key)
 		}
 		if (!(flags & CONSOLE_COUNTDOWN_SILENT) &&
 		    is_timeout(second, SECOND)) {
-			printf("\b\b%2d", countdown--);
+			printf("\b\b\b\b%4d", countdown--);
 			second += SECOND;
 		}
 	} while (!is_timeout(start, timeout_s * SECOND));
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-03-13  8:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-09 17:05 [PATCH 1/3] console_countdown: width to of countdown to 4 digits Oleksij Rempel
2017-03-09 17:05 ` [PATCH 2/3] console_countdown: add possibility to abort countdown by external commands Oleksij Rempel
2017-03-09 17:05 ` [PATCH 3/3] fastboot: abort autoboot timeout when fastboot gadget is activated Oleksij Rempel
2017-03-09 17:58 ` [PATCH v2 1/3] console_countdown: width to of countdown to 4 digits Oleksij Rempel
2017-03-09 17:58   ` [PATCH v2 2/3] console_countdown: add possibility to abort countdown by external commands Oleksij Rempel
2017-03-09 18:18     ` Marc Kleine-Budde
2017-03-10  6:05     ` [PATCH v3 0/3] upstream console_countdown related work Oleksij Rempel
2017-03-10  6:05       ` [PATCH v3 1/3] console_countdown: width to of countdown to 4 digits Oleksij Rempel
2017-03-10  6:05       ` [PATCH v3 2/3] console_countdown: add possibility to abort countdown by external commands Oleksij Rempel
2017-03-10  9:14         ` Jean-Christophe PLAGNIOL-VILLARD
2017-03-13  8:07           ` Sascha Hauer
2017-03-10  6:05       ` [PATCH v3 3/3] fastboot: abort autoboot timeout when fastboot gadget is activated Oleksij Rempel
2017-03-10  7:49       ` [PATCH v3 0/3] upstream console_countdown related work Sascha Hauer
2017-03-09 17:58   ` [PATCH v2 3/3] fastboot: abort autoboot timeout when fastboot gadget is activated Oleksij Rempel
2017-03-09 21:44 ` [PATCH 1/3] console_countdown: width to of countdown to 4 digits Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox