mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
Allow console input to be disabled
Added new CONFIG_DISABLE_CONSOLE define and GD_FLG_DISABLE_CONSOLE. When CONFIG_DISABLE_CONSOLE is defined, setting GD_FLG_DISABLE_CONSOLE disables all console input and output. Signed-off-by: Mark Jackson <mpfj@mimc.co.uk>
This commit is contained in:
committed by
Wolfgang Denk
parent
2b22d608f3
commit
f5c3ba7978
@@ -162,6 +162,11 @@ void fprintf (int file, const char *fmt, ...)
|
||||
|
||||
int getc (void)
|
||||
{
|
||||
#ifdef CONFIG_DISABLE_CONSOLE
|
||||
if (gd->flags & GD_FLG_DISABLE_CONSOLE)
|
||||
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)
|
||||
{
|
||||
#ifdef CONFIG_DISABLE_CONSOLE
|
||||
if (gd->flags & GD_FLG_DISABLE_CONSOLE)
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
if (gd->flags & GD_FLG_DEVINIT) {
|
||||
/* Test the standard input */
|
||||
return ftstc (stdin);
|
||||
@@ -189,6 +199,11 @@ void putc (const char c)
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DISABLE_CONSOLE
|
||||
if (gd->flags & GD_FLG_DISABLE_CONSOLE)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (gd->flags & GD_FLG_DEVINIT) {
|
||||
/* Send to the standard output */
|
||||
fputc (stdout, c);
|
||||
@@ -205,6 +220,11 @@ void puts (const char *s)
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DISABLE_CONSOLE
|
||||
if (gd->flags & GD_FLG_DISABLE_CONSOLE)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (gd->flags & GD_FLG_DEVINIT) {
|
||||
/* Send to the standard output */
|
||||
fputs (stdout, s);
|
||||
|
Reference in New Issue
Block a user