Within tests it is useful to be able to control rendering of the expo. Drop the automatic call to expo_render() within expo_poll() and adjust its callers to handle this instead.
Signed-off-by: Simon Glass <s...@chromium.org> --- boot/cedit.c | 1 + boot/expo.c | 2 -- cmd/bootflow.c | 1 + include/expo.h | 9 ++++++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/boot/cedit.c b/boot/cedit.c index 46a48d69347..e9fdd355b7e 100644 --- a/boot/cedit.c +++ b/boot/cedit.c @@ -213,6 +213,7 @@ int cedit_run(struct expo *exp) do { struct expo_action act; + LOGR("cer", expo_render(exp)); ret = expo_poll(exp, &act); if (!ret) { cedit_do_action(exp, scn, vid_priv, &act); diff --git a/boot/expo.c b/boot/expo.c index bf2f1dfc68a..4f96b5ee973 100644 --- a/boot/expo.c +++ b/boot/expo.c @@ -320,8 +320,6 @@ int expo_poll(struct expo *exp, struct expo_action *act) { int ichar, key; - LOGR("ere", expo_render(exp)); - ichar = cli_ch_process(&exp->cch, 0); if (!ichar) { int i; diff --git a/cmd/bootflow.c b/cmd/bootflow.c index 2871d91dd29..b8f61f966fb 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -114,6 +114,7 @@ __maybe_unused static int bootflow_handle_menu(struct bootstd_priv *std, LOGR("bhs", bootflow_menu_start(std, text_mode, &exp)); do { + LOGR("bhr", expo_render(exp)); ret = bootflow_menu_poll(exp, &bflow); } while (ret == -EAGAIN); // printf("ret %d bflow %p\n", ret, bflow); diff --git a/include/expo.h b/include/expo.h index dfecd6ed239..2addddd5012 100644 --- a/include/expo.h +++ b/include/expo.h @@ -1006,10 +1006,13 @@ int expo_build(ofnode root, struct expo **expp); int cb_expo_build(struct expo **expp); /** - * expo_poll() - render an expo and see if the user takes an action + * expo_poll() - see if the user takes an action * - * Thsi calls expo_render() and then checks for a keypress. If there is one, it - * is processed and the resulting action returned, if any + * This checks for a keypress. If there is one, it is processed and the + * resulting action returned, if any. + * + * Note that expo_render() should normally be called immediately before this + * function so that the user can see the latest state. * * @exp: Expo to poll * @act: Returns action on success -- 2.43.0