From 3ad4143bb11dd98f47c80e0b93d39b59c2f8e329 Mon Sep 17 00:00:00 2001 From: Leo C Date: Fri, 8 May 2015 18:45:36 +0200 Subject: connect command: check serial input, even if Z180 sends really fast. --- avr/cmd_boot.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'avr') diff --git a/avr/cmd_boot.c b/avr/cmd_boot.c index 301f4f5..f9f8f90 100644 --- a/avr/cmd_boot.c +++ b/avr/cmd_boot.c @@ -194,9 +194,11 @@ command_ret_t do_console(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv pending = (Stat & S_CON_PENDING) != 0; Stat &= ~S_CON_PENDING; } - if (pending) - while ((ch = z80_memfifo_getc(fifo_conout)) >= 0) + if (pending) { + uint8_t count = 100; + while ((ch = z80_memfifo_getc(fifo_conout)) >= 0 && --count) putchar(ch); + } if ((ch = my_getchar(0)) >= 0) { switch (state) { -- cgit v1.2.3