mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
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>
This commit is contained in:
@@ -14,12 +14,14 @@
|
||||
*
|
||||
* @esc_len: Number of escape characters read so far
|
||||
* @esc_save: Escape characters collected so far
|
||||
* @emit_upto: Next character to emit from esc_save (0 if not emitting)
|
||||
* @emit_upto: Next index to emit from esc_save
|
||||
* @emitting: true if emitting from esc_save
|
||||
*/
|
||||
struct cli_ch_state {
|
||||
int esc_len;
|
||||
char esc_save[8];
|
||||
int emit_upto;
|
||||
bool emitting;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#ifndef __MENU_H__
|
||||
#define __MENU_H__
|
||||
|
||||
struct cli_ch_state;
|
||||
struct menu;
|
||||
|
||||
struct menu *menu_create(char *title, int timeout, int prompt,
|
||||
@@ -71,7 +72,8 @@ enum bootmenu_key {
|
||||
* Ctrl-C: KEY_QUIT
|
||||
* anything else: KEY_NONE
|
||||
*/
|
||||
enum bootmenu_key bootmenu_autoboot_loop(struct bootmenu_data *menu, int *esc);
|
||||
enum bootmenu_key bootmenu_autoboot_loop(struct bootmenu_data *menu,
|
||||
struct cli_ch_state *cch);
|
||||
|
||||
/**
|
||||
* bootmenu_loop() - handle waiting for a keypress when autoboot is disabled
|
||||
@@ -96,6 +98,7 @@ enum bootmenu_key bootmenu_autoboot_loop(struct bootmenu_data *menu, int *esc);
|
||||
* Minus: BKEY_MINUS
|
||||
* Space: BKEY_SPACE
|
||||
*/
|
||||
enum bootmenu_key bootmenu_loop(struct bootmenu_data *menu, int *esc);
|
||||
enum bootmenu_key bootmenu_loop(struct bootmenu_data *menu,
|
||||
struct cli_ch_state *cch);
|
||||
|
||||
#endif /* __MENU_H__ */
|
||||
|
||||
Reference in New Issue
Block a user