From: Piotr Dymacz Date: Thu, 31 Mar 2016 09:30:35 +0000 (+0200) Subject: Ignore null character when waiting for autoboot abort X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=247b1d69137d991af406d854d14ae039585ae096;p=oweals%2Fu-boot_mod.git Ignore null character when waiting for autoboot abort --- 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); }