pandora: Add menu entry to enter console
authorUrja Rannikko <urjaman@gmail.com>
Sat, 22 Jun 2013 22:45:36 +0000 (23:45 +0100)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 3 Jul 2016 00:10:27 +0000 (03:10 +0300)
Signed-off-by: Urja Rannikko <urjaman@gmail.com>
board/pandora/menu.c

index 8fd4885..eba4595 100644 (file)
@@ -91,6 +91,18 @@ static int menu_do_serial(struct menu_item *item)
        return 1;
 }
 
+#ifdef CONFIG_KEYBOARD
+static int menu_do_console(struct menu_item *item)
+{
+       printf("Switched to console.\n");
+       setenv("stdout", "lcd");
+       setenv("stderr", "lcd");
+       setenv("stdin",  "kbd");
+       setenv("bootcmd", "");
+       return 1;
+}
+#endif
+
 static int menu_do_script_cmd(struct menu_item *item)
 {
        int failed = 0;
@@ -183,6 +195,9 @@ static struct menu_item default_menu_items[] = {
        { "power off",          menu_do_poweroff, },
        { "USB serial prompt",  menu_do_usb_serial, },
        { "serial prompt",      menu_do_serial, },
+#ifdef CONFIG_KEYBOARD
+       { "console prompt",     menu_do_console, },
+#endif
 };
 
 static void do_mmc(int dev_id)