mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-30 19:11:37 +00:00
hush: Pull out U-Boot prompt display and read functionality
Pull the code which displays U-Boot prompt and reads the command line into a separate function. No functional change. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
dffceb4b15
commit
13d3046fa3
1 changed files with 16 additions and 5 deletions
|
@ -974,6 +974,20 @@ static inline void setup_prompt_string(int promptmode, char **prompt_str)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __U_BOOT__
|
||||||
|
static int uboot_cli_readline(struct in_str *i)
|
||||||
|
{
|
||||||
|
char *prompt;
|
||||||
|
|
||||||
|
if (i->promptmode == 1)
|
||||||
|
prompt = CONFIG_SYS_PROMPT;
|
||||||
|
else
|
||||||
|
prompt = CONFIG_SYS_PROMPT_HUSH_PS2;
|
||||||
|
|
||||||
|
return cli_readline(prompt);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void get_user_input(struct in_str *i)
|
static void get_user_input(struct in_str *i)
|
||||||
{
|
{
|
||||||
#ifndef __U_BOOT__
|
#ifndef __U_BOOT__
|
||||||
|
@ -1003,11 +1017,8 @@ static void get_user_input(struct in_str *i)
|
||||||
|
|
||||||
bootretry_reset_cmd_timeout();
|
bootretry_reset_cmd_timeout();
|
||||||
i->__promptme = 1;
|
i->__promptme = 1;
|
||||||
if (i->promptmode == 1) {
|
n = uboot_cli_readline(i);
|
||||||
n = cli_readline(CONFIG_SYS_PROMPT);
|
|
||||||
} else {
|
|
||||||
n = cli_readline(CONFIG_SYS_PROMPT_HUSH_PS2);
|
|
||||||
}
|
|
||||||
#ifdef CONFIG_BOOT_RETRY_TIME
|
#ifdef CONFIG_BOOT_RETRY_TIME
|
||||||
if (n == -2) {
|
if (n == -2) {
|
||||||
puts("\nTimeout waiting for command\n");
|
puts("\nTimeout waiting for command\n");
|
||||||
|
|
Loading…
Add table
Reference in a new issue