summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2025-05-02 08:46:15 -0600
committerSimon Glass <[email protected]>2025-05-30 09:49:31 +0100
commit5c365ecabcac6d3218cf7e560bda01629a46d88e (patch)
tree59dd168bdade393dc3f0d84f2fa1aadf2293cdc4 /boot
parent4f4b9477f4476cd86ffd4219111065d610c5237a (diff)
expo: Add CLI context to the expo
An expo generally needs to keep track of the keyboard state while it is running, so move the context into struct expo Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'boot')
-rw-r--r--boot/bootflow_menu.c9
-rw-r--r--boot/cedit.c8
-rw-r--r--boot/expo.c1
3 files changed, 7 insertions, 11 deletions
diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c
index 9d0dc352f97..43125e15832 100644
--- a/boot/bootflow_menu.c
+++ b/boot/bootflow_menu.c
@@ -178,7 +178,6 @@ int bootflow_menu_apply_theme(struct expo *exp, ofnode node)
int bootflow_menu_run(struct bootstd_priv *std, bool text_mode,
struct bootflow **bflowp)
{
- struct cli_ch_state s_cch, *cch = &s_cch;
struct bootflow *sel_bflow;
struct udevice *dev;
struct expo *exp;
@@ -186,8 +185,6 @@ int bootflow_menu_run(struct bootstd_priv *std, bool text_mode,
bool done;
int ret;
- cli_ch_init(cch);
-
sel_bflow = NULL;
*bflowp = NULL;
@@ -225,16 +222,16 @@ int bootflow_menu_run(struct bootstd_priv *std, bool text_mode,
if (ret)
break;
- ichar = cli_ch_process(cch, 0);
+ ichar = cli_ch_process(&exp->cch, 0);
if (!ichar) {
while (!ichar && !tstc()) {
schedule();
mdelay(2);
- ichar = cli_ch_process(cch, -ETIMEDOUT);
+ ichar = cli_ch_process(&exp->cch, -ETIMEDOUT);
}
if (!ichar) {
ichar = getchar();
- ichar = cli_ch_process(cch, ichar);
+ ichar = cli_ch_process(&exp->cch, ichar);
}
}
diff --git a/boot/cedit.c b/boot/cedit.c
index 4e80875828b..ed499f11140 100644
--- a/boot/cedit.c
+++ b/boot/cedit.c
@@ -151,14 +151,12 @@ int cedit_prepare(struct expo *exp, struct video_priv **vid_privp,
int cedit_run(struct expo *exp)
{
- struct cli_ch_state s_cch, *cch = &s_cch;
struct video_priv *vid_priv;
uint scene_id;
struct scene *scn;
bool done, save;
int ret;
- cli_ch_init(cch);
ret = cedit_prepare(exp, &vid_priv, &scn);
if (ret < 0)
return log_msg_ret("prep", ret);
@@ -174,16 +172,16 @@ int cedit_run(struct expo *exp)
if (ret)
break;
- ichar = cli_ch_process(cch, 0);
+ ichar = cli_ch_process(&exp->cch, 0);
if (!ichar) {
while (!ichar && !tstc()) {
schedule();
mdelay(2);
- ichar = cli_ch_process(cch, -ETIMEDOUT);
+ ichar = cli_ch_process(&exp->cch, -ETIMEDOUT);
}
if (!ichar) {
ichar = getchar();
- ichar = cli_ch_process(cch, ichar);
+ ichar = cli_ch_process(&exp->cch, ichar);
}
}
diff --git a/boot/expo.c b/boot/expo.c
index 8ce645e5a8f..9c042f16fe7 100644
--- a/boot/expo.c
+++ b/boot/expo.c
@@ -30,6 +30,7 @@ int expo_new(const char *name, void *priv, struct expo **expp)
INIT_LIST_HEAD(&exp->scene_head);
INIT_LIST_HEAD(&exp->str_head);
exp->next_id = EXPOID_BASE_ID;
+ cli_ch_init(&exp->cch);
*expp = exp;