summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c13
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Ui.c36
2 files changed, 32 insertions, 17 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c b/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c
index 720efb9a04..ae783b4ae3 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c
@@ -1384,10 +1384,17 @@ WaitForKeyStroke (
{
EFI_STATUS Status;
- do {
- UiWaitForSingleEvent (gST->ConIn->WaitForKey, 0, 0);
+ while (TRUE) {
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, Key);
- } while (EFI_ERROR(Status));
+ if (!EFI_ERROR (Status)) {
+ break;
+ }
+ if (Status != EFI_NOT_READY) {
+ continue;
+ }
+
+ UiWaitForSingleEvent (gST->ConIn->WaitForKey, 0, 0);
+ }
return Status;
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
index d0d45277a1..b011ad39ec 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
@@ -3110,25 +3110,33 @@ UiDisplayMenu (
//
// Wait for user's selection
//
- do {
- Status = UiWaitForSingleEvent (gST->ConIn->WaitForKey, 0, MinRefreshInterval);
- } while (Status == EFI_TIMEOUT);
+ while (TRUE) {
+ Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
+ if (!EFI_ERROR (Status)) {
+ break;
+ }
- if (Selection->Action == UI_ACTION_REFRESH_FORMSET) {
//
- // IFR is updated in Callback of refresh opcode, re-parse it
+ // If we encounter error, continue to read another key in.
//
- ControlFlag = CfCheckSelection;
- Selection->Statement = NULL;
- break;
+ if (Status != EFI_NOT_READY) {
+ continue;
+ }
+
+ Status = UiWaitForSingleEvent (gST->ConIn->WaitForKey, 0, MinRefreshInterval);
+ ASSERT_EFI_ERROR (Status);
+
+ if (Selection->Action == UI_ACTION_REFRESH_FORMSET) {
+ //
+ // IFR is updated in Callback of refresh opcode, re-parse it
+ //
+ ControlFlag = CfCheckSelection;
+ Selection->Statement = NULL;
+ break;
+ }
}
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- //
- // If we encounter error, continue to read another key in.
- //
- if (EFI_ERROR (Status)) {
- ControlFlag = CfReadKey;
+ if (ControlFlag == CfCheckSelection) {
break;
}