Skip to content

Latest commit

 

History

History
131 lines (101 loc) · 3.43 KB

menus.rst

File metadata and controls

131 lines (101 loc) · 3.43 KB

Menus

U-Boot provides a set of interfaces for creating and using simple, text based menus. Menus are displayed as lists of labeled entries on the console, and an entry can be selected by entering its label.

To use the menu code, enable CONFIG_MENU, and include "menu.h" where the interfaces should be available.

Menus are composed of items. Each item has a key used to identify it in the menu, and an opaque pointer to data controlled by the consumer.

If you want to show a menu, instead starting the shell, define CONFIG_AUTOBOOT_MENU_SHOW. You have to code the int menu_show(int bootdelay) function, which handle your menu. This function returns the remaining bootdelay.

Interfaces

Example Code

This example creates a menu that always prompts, and allows the user to pick from a list of tools. The item key and data are the same.