[PATCH 3/6] bootmenu: Cancel delay only when a real key is pressed

Simon Glass sjg at chromium.org
Sat Jun 17 12:49:50 CEST 2023


We need to decode the input character before deciding if it is a real
key, or just part of an escape sequence. Check this.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 common/menu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/menu.c b/common/menu.c
index b55cf7b99967..c81494b3d1f3 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -446,11 +446,14 @@ enum bootmenu_key bootmenu_autoboot_loop(struct bootmenu_data *menu,
 				continue;
 			}
 
-			menu->delay = -1;
 			c = getchar();
 
 			ichar = cli_ch_process(cch, c);
 
+			if (!ichar)
+				continue;
+			menu->delay = -1;
+
 			switch (ichar) {
 			case '\0':
 				key = BKEY_NONE;
-- 
2.41.0.162.gfafddb0af9-goog



More information about the U-Boot mailing list