]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/cmd_boot.c
change message buffer initialization
[z180-stamp.git] / avr / cmd_boot.c
index 4775b6ea04d376aeaaeb8bc04e0edbd19799eea5..f9f8f90f15cc26a15862cb20bb33e4fc2856c4f1 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
+ *
+ * (C) Copyright 2000-2003
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
 
 /*
  * Misc boot support
@@ -186,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) {