diff options
author | Leo C | 2015-05-08 18:45:36 +0200 |
---|---|---|
committer | Leo C | 2015-05-08 18:45:36 +0200 |
commit | 3ad4143bb11dd98f47c80e0b93d39b59c2f8e329 (patch) | |
tree | 64d9e4b78b3da061b4507d6cb7223b124ae4aef5 /avr/cmd_boot.c | |
parent | c0abd68b350ffd9852923a66f3ee6c315c94813a (diff) | |
download | z180-stamp-3ad4143bb11dd98f47c80e0b93d39b59c2f8e329.zip |
connect command: check serial input, even if Z180 sends really fast.
Diffstat (limited to 'avr/cmd_boot.c')
-rw-r--r-- | avr/cmd_boot.c | 6 |
1 files changed, 4 insertions, 2 deletions
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) { |