[PATCH 4/6] boobtmenu: Add debugging

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


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

 cmd/bootmenu.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c
index 6baeedc69f91..b2fb119e70f9 100644
--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
@@ -18,6 +18,8 @@
 #include <linux/delay.h>
 #include <linux/string.h>
 
+#define ansi 0
+
 /* maximum bootmenu entries */
 #define MAX_COUNT	99
 
@@ -101,6 +103,7 @@ static char *bootmenu_choice_entry(void *data)
 			/* Some key was pressed, so autoboot was stopped */
 			key = bootmenu_loop(menu, cch);
 		}
+		printf("[got bkey %d]\n", key);
 
 		switch (key) {
 		case BKEY_UP:
@@ -521,9 +524,11 @@ static enum bootmenu_ret bootmenu_show(int delay)
 	/* Default menu entry is always first */
 	menu_default_set(menu, "0");
 
-	puts(ANSI_CURSOR_HIDE);
-	puts(ANSI_CLEAR_CONSOLE);
-	printf(ANSI_CURSOR_POSITION, 1, 1);
+	if (ansi) {
+// 		puts(ANSI_CURSOR_HIDE);
+// 		puts(ANSI_CLEAR_CONSOLE);
+// 		printf(ANSI_CURSOR_POSITION, 1, 1);
+	}
 
 	init = 1;
 
@@ -566,10 +571,10 @@ cleanup:
 	menu_destroy(menu);
 	bootmenu_destroy(bootmenu);
 
-	if (init) {
-		puts(ANSI_CURSOR_SHOW);
-		puts(ANSI_CLEAR_CONSOLE);
-		printf(ANSI_CURSOR_POSITION, 1, 1);
+	if (init && ansi) {
+// 		puts(ANSI_CURSOR_SHOW);
+// 		puts(ANSI_CLEAR_CONSOLE);
+// 		printf(ANSI_CURSOR_POSITION, 1, 1);
 	}
 
 	if (title && command) {
-- 
2.41.0.162.gfafddb0af9-goog



More information about the U-Boot mailing list