menu: add support to check if menu needs to be reprinted
This patch adds a new callback named need_reprint for menu. The need_reprint will be called before printing the menu. If the callback exists and returns FALSE, menu printing will be canceled. This is very useful if the menu was not changed. It can save time for serial-based menu to handle more input data. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Reviewed-by: Daniel Golle <daniel@makrotopia.org> Tested-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
@@ -506,7 +506,7 @@ static enum bootmenu_ret bootmenu_show(int delay)
|
||||
|
||||
menu = menu_create(NULL, bootmenu->delay, 1, menu_display_statusline,
|
||||
bootmenu_print_entry, bootmenu_choice_entry,
|
||||
bootmenu);
|
||||
NULL, bootmenu);
|
||||
if (!menu) {
|
||||
bootmenu_destroy(bootmenu);
|
||||
return BOOTMENU_RET_FAIL;
|
||||
|
Reference in New Issue
Block a user