mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-09-21 02:51:04 +02:00
move WaitForInputEventPoll.
This commit is contained in:
parent
b609bfef1c
commit
4a9a99873d
@ -703,6 +703,38 @@ UINTN REFIT_MENU_SCREEN::InputDialog(IN MENU_STYLE_FUNC StyleFunc)
|
||||
}
|
||||
|
||||
|
||||
// TimeoutDefault for a wait in seconds
|
||||
// return EFI_TIMEOUT if no inputs
|
||||
//the function must be in menu class
|
||||
//so UpdatePointer(); => mPointer.Update(&gItemID, &Screen->mAction);
|
||||
EFI_STATUS WaitForInputEventPoll(REFIT_MENU_SCREEN* ScreenPtr, UINTN TimeoutDefault)
|
||||
{
|
||||
REFIT_MENU_SCREEN& Screen = *ScreenPtr;
|
||||
EFI_STATUS Status = EFI_SUCCESS;
|
||||
UINTN TimeoutRemain = TimeoutDefault * 100;
|
||||
|
||||
while (TimeoutRemain != 0) {
|
||||
Status = WaitFor2EventWithTsc (gST->ConIn->WaitForKey, NULL, 10);
|
||||
if (Status != EFI_TIMEOUT) {
|
||||
break;
|
||||
}
|
||||
Screen.UpdateFilm();
|
||||
if (gSettings.PlayAsync) {
|
||||
CheckSyncSound();
|
||||
}
|
||||
TimeoutRemain--;
|
||||
if (Screen.mPointer.isAlive()) {
|
||||
Screen.mPointer.UpdatePointer();
|
||||
Status = Screen.CheckMouseEvent(); //out: gItemID, gAction
|
||||
if (Status != EFI_TIMEOUT) { //this check should return timeout if no mouse events occured
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN MENU_STYLE_FUNC StyleFunc, IN OUT INTN *DefaultEntryIndex, OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
@ -1064,37 +1064,6 @@ WaitFor2EventWithTsc (
|
||||
#define ONE_SECOND 10000000
|
||||
#define ONE_MSECOND 10000
|
||||
|
||||
// TimeoutDefault for a wait in seconds
|
||||
// return EFI_TIMEOUT if no inputs
|
||||
//the function must be in menu class
|
||||
//so UpdatePointer(); => mPointer.Update(&gItemID, &Screen->mAction);
|
||||
EFI_STATUS WaitForInputEventPoll(REFIT_MENU_SCREEN* ScreenPtr, UINTN TimeoutDefault)
|
||||
{
|
||||
REFIT_MENU_SCREEN& Screen = *ScreenPtr;
|
||||
EFI_STATUS Status = EFI_SUCCESS;
|
||||
UINTN TimeoutRemain = TimeoutDefault * 100;
|
||||
|
||||
while (TimeoutRemain != 0) {
|
||||
Status = WaitFor2EventWithTsc (gST->ConIn->WaitForKey, NULL, 10);
|
||||
if (Status != EFI_TIMEOUT) {
|
||||
break;
|
||||
}
|
||||
Screen.UpdateFilm();
|
||||
if (gSettings.PlayAsync) {
|
||||
CheckSyncSound();
|
||||
}
|
||||
TimeoutRemain--;
|
||||
if (Screen.mPointer.isAlive()) {
|
||||
Screen.mPointer.UpdatePointer();
|
||||
Status = Screen.CheckMouseEvent(); //out: gItemID, gAction
|
||||
if (Status != EFI_TIMEOUT) { //this check should return timeout if no mouse events occured
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN
|
||||
SetPageBreak (
|
||||
|
@ -286,8 +286,6 @@ WaitFor2EventWithTsc (
|
||||
IN UINT64 Timeout OPTIONAL
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
WaitForInputEventPoll(REFIT_MENU_SCREEN *Screen, UINTN TimeoutDefault);
|
||||
|
||||
//VOID LowCase (IN OUT CHAR8 *Str);
|
||||
UINT32 hex2bin(IN CHAR8 *hex, OUT UINT8 *bin, UINT32 len);
|
||||
|
Loading…
Reference in New Issue
Block a user