bootstd: Indicate refresh need with bootflow_menu_poll()
When the user presses 'up' when on the top menu item, it is a waste of time to refresh since nothing has changed. Add a new return code from this function to indicate that the UI must be refreshed. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -309,6 +309,8 @@ int bootflow_menu_poll(struct expo *exp, int *seqp)
|
||||
ret = scene_menu_select_item(scn, OBJ_MENU, act.select.id);
|
||||
if (ret)
|
||||
return log_msg_ret("bmp", ret);
|
||||
if (act.select.changed)
|
||||
return -EREMCHG;
|
||||
return -ERESTART;
|
||||
}
|
||||
case EXPOACT_QUIT:
|
||||
|
||||
@@ -126,7 +126,7 @@ __maybe_unused static int bootflow_handle_menu(struct bootstd_priv *std,
|
||||
return log_msg_ret("bhr", ret);
|
||||
}
|
||||
ret = bootflow_menu_poll(exp, &seq);
|
||||
} while (ret == -EAGAIN || ret == -ERESTART);
|
||||
} while (ret == -EAGAIN || ret == -ERESTART || ret == -EREMCHG);
|
||||
|
||||
if (ret == -EPIPE) {
|
||||
printf("Nothing chosen\n");
|
||||
|
||||
@@ -699,7 +699,9 @@ int bootflow_menu_start(struct bootstd_priv *std, bool text_mode,
|
||||
* @exp: Expo to poll
|
||||
* @seqp: Returns the bootflow chosen or currently pointed to (numbered from 0)
|
||||
* Return: 0 if a bootflow was chosen, -EAGAIN if nothing is chosen yet, -EPIPE
|
||||
* if the user quit, -ERESTART if the expo needs refreshing
|
||||
* if the user quit, -EREMCHG if the expo needs refreshing, -ERESTART if
|
||||
* the user tried to move to a new selection but was unable (e.g. already
|
||||
* at the top and tried to move up)
|
||||
*/
|
||||
int bootflow_menu_poll(struct expo *exp, int *seqp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user