From: Leo C Date: Fri, 8 May 2015 16:45:36 +0000 (+0200) Subject: connect command: check serial input, even if Z180 sends really fast. X-Git-Tag: hexrel-6~12 X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/commitdiff_plain/3ad4143bb11dd98f47c80e0b93d39b59c2f8e329 connect command: check serial input, even if Z180 sends really fast. --- 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) {