mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
expo: Adjust expo_poll() to avoid looping forever
If the user does not quickly provide some input, exit so that other things can be done, such as searching for the next OS. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
0dc8c7740c
commit
5bca479897
@ -326,12 +326,14 @@ int expo_poll(struct expo *exp, struct expo_action *act)
|
||||
|
||||
ichar = cli_ch_process(&exp->cch, 0);
|
||||
if (!ichar) {
|
||||
while (!ichar && !tstc()) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 10 && !ichar && !tstc(); i++) {
|
||||
schedule();
|
||||
mdelay(2);
|
||||
ichar = cli_ch_process(&exp->cch, -ETIMEDOUT);
|
||||
}
|
||||
if (!ichar) {
|
||||
while (!ichar && tstc()) {
|
||||
ichar = getchar();
|
||||
ichar = cli_ch_process(&exp->cch, ichar);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user