diff options
author | Simon Glass <sjg@chromium.org> | 2023-01-06 08:52:26 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-01-16 14:14:11 -0500 |
commit | 32bab0eae51b55898d1e2804e6614d9143840581 (patch) | |
tree | 67686cc8705aaf301695e8b66f50f613422b60b9 /cmd/bootmenu.c | |
parent | 86cc3c5215fc6e3c2cb77ee162c22ad91dbfaff5 (diff) | |
download | u-boot-32bab0eae51b55898d1e2804e6614d9143840581.tar.gz |
menu: Make use of CLI character processing
Avoid duplicating some of the escape-sequence processing here and use the
CLI function instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd/bootmenu.c')
-rw-r--r-- | cmd/bootmenu.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c index 43553dbcc9..3236ca5d79 100644 --- a/cmd/bootmenu.c +++ b/cmd/bootmenu.c @@ -4,6 +4,7 @@ */ #include <charset.h> +#include <cli.h> #include <common.h> #include <command.h> #include <ansi.h> @@ -84,19 +85,21 @@ static void bootmenu_print_entry(void *data) static char *bootmenu_choice_entry(void *data) { + struct cli_ch_state s_cch, *cch = &s_cch; struct bootmenu_data *menu = data; struct bootmenu_entry *iter; enum bootmenu_key key = BKEY_NONE; - int esc = 0; int i; + cli_ch_init(cch); + while (1) { if (menu->delay >= 0) { /* Autoboot was not stopped */ - key = bootmenu_autoboot_loop(menu, &esc); + key = bootmenu_autoboot_loop(menu, cch); } else { /* Some key was pressed, so autoboot was stopped */ - key = bootmenu_loop(menu, &esc); + key = bootmenu_loop(menu, cch); } switch (key) { |