{\r
EFI_STATUS Status;\r
\r
- do {\r
- UiWaitForSingleEvent (gST->ConIn->WaitForKey, 0, 0);\r
+ while (TRUE) {\r
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, Key);\r
- } while (EFI_ERROR(Status));\r
+ if (!EFI_ERROR (Status)) {\r
+ break;\r
+ }\r
\r
+ if (Status != EFI_NOT_READY) {\r
+ continue;\r
+ }\r
+\r
+ UiWaitForSingleEvent (gST->ConIn->WaitForKey, 0, 0);\r
+ }\r
return Status;\r
}\r
//\r
// Wait for user's selection\r
//\r
- do {\r
- Status = UiWaitForSingleEvent (gST->ConIn->WaitForKey, 0, MinRefreshInterval);\r
- } while (Status == EFI_TIMEOUT);\r
+ while (TRUE) {\r
+ Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
+ if (!EFI_ERROR (Status)) {\r
+ break;\r
+ }\r
\r
- if (Selection->Action == UI_ACTION_REFRESH_FORMSET) {\r
//\r
- // IFR is updated in Callback of refresh opcode, re-parse it\r
+ // If we encounter error, continue to read another key in.\r
//\r
- ControlFlag = CfCheckSelection;\r
- Selection->Statement = NULL;\r
- break;\r
+ if (Status != EFI_NOT_READY) {\r
+ continue;\r
+ }\r
+\r
+ Status = UiWaitForSingleEvent (gST->ConIn->WaitForKey, 0, MinRefreshInterval);\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ if (Selection->Action == UI_ACTION_REFRESH_FORMSET) {\r
+ //\r
+ // IFR is updated in Callback of refresh opcode, re-parse it\r
+ //\r
+ ControlFlag = CfCheckSelection;\r
+ Selection->Statement = NULL;\r
+ break;\r
+ }\r
}\r
\r
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
- //\r
- // If we encounter error, continue to read another key in.\r
- //\r
- if (EFI_ERROR (Status)) {\r
- ControlFlag = CfReadKey;\r
+ if (ControlFlag == CfCheckSelection) {\r
break;\r
}\r
\r