]> cloudbase.mooo.com Git - z180-stamp.git/commitdiff
connect command: check serial input, even if Z180 sends really fast.
authorLeo C <erbl259-lmu@yahoo.de>
Fri, 8 May 2015 16:45:36 +0000 (18:45 +0200)
committerLeo C <erbl259-lmu@yahoo.de>
Fri, 8 May 2015 16:45:36 +0000 (18:45 +0200)
avr/cmd_boot.c

index 301f4f583d4e02a8015b481edbed1d02064058b6..f9f8f90f15cc26a15862cb20bb33e4fc2856c4f1 100644 (file)
@@ -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) {