From 247b1d69137d991af406d854d14ae039585ae096 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Thu, 31 Mar 2016 11:30:35 +0200 Subject: [PATCH] Ignore null character when waiting for autoboot abort --- u-boot/common/main.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/u-boot/common/main.c b/u-boot/common/main.c index 42f3d57..6c50e7a 100644 --- a/u-boot/common/main.c +++ b/u-boot/common/main.c @@ -58,9 +58,7 @@ static char tab_seq[] = " "; /* used to expand TABs */ */ #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) static __inline__ int abortboot(int bootdelay){ -#ifdef CONFIG_AUTOBOOT_STOP_CHAR char stopc; -#endif int abort = 0; #ifdef CONFIG_SILENT_CONSOLE @@ -85,26 +83,19 @@ static __inline__ int abortboot(int bootdelay){ /* delay 100 * 10ms */ for(i = 0; !abort && i < 100; ++i){ - /* we got a key press */ if(tstc()){ -#ifdef CONFIG_AUTOBOOT_STOP_CHAR stopc = getc(); +#ifdef CONFIG_AUTOBOOT_STOP_CHAR if (stopc == CONFIG_AUTOBOOT_STOP_CHAR) { +#else + if (stopc != 0) { +#endif abort = 1; bootdelay = 0; break; } -#else - /* don't auto boot */ - abort = 1; - /* no more delay */ - bootdelay = 0; - /* consume input */ - (void) getc(); - break; -#endif /* CONFIG_AUTOBOOT_STOP_CHAR */ } udelay(10000); } -- 2.25.1