[U-Boot-Users] [PATCH] Allow console input to be disabled

Mark Jackson mpfj at mimc.co.uk
Wed Jul 30 14:17:43 CEST 2008


Added CONFIG_SILENT_CONSOLE_INPUT define.

When used (in conjunction with CONFIG_SILENT_CONSOLE) it disables all console input.

---

 common/console.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/common/console.c b/common/console.c
index 1b095b1..ab071e2 100644
--- a/common/console.c
+++ b/common/console.c
@@ -162,6 +162,11 @@ void fprintf (int file, const char *fmt, ...)
 
 int getc (void)
 {
+#if defined(CONFIG_SILENT_CONSOLE) && defined(CONFIG_SILENT_CONSOLE_INPUT)
+	if (gd->flags & GD_FLG_SILENT)
+		return 0;
+#endif
+
 	if (gd->flags & GD_FLG_DEVINIT) {
 		/* Get from the standard input */
 		return fgetc (stdin);
@@ -173,6 +178,11 @@ int getc (void)
 
 int tstc (void)
 {
+#if defined(CONFIG_SILENT_CONSOLE) && defined(CONFIG_SILENT_CONSOLE_INPUT)
+	if (gd->flags & GD_FLG_SILENT)
+		return 0;
+#endif
+
 	if (gd->flags & GD_FLG_DEVINIT) {
 		/* Test the standard input */
 		return ftstc (stdin);




More information about the U-Boot mailing list