Timer Events With Notification Function
Talk is cheap, show me your code!
//
EFI_EVENT myEvent;
VOID TimerEventNotify3s(IN EFI_EVENT Event, IN VOID *Context)
{
// static UINTN times = 0;
Print(L"Timer Event triggerd");
}
Status = gBS->CreateEvent (
EVT_TIMER | EVT_NOTIFY_SIGNAL, // Type
TPL_CALLBACK,
(EFI_EVENT_NOTIFY)TimerEvent3s,// NotifyFunction
(VOID*)NULL, // NotifyContext
&myEvent // Event
);
Status = gBS->SetTimer (
myEvent,
TimerRelative,
EFI_TIMER_PERIOD_SECONDS (3)
);
do {
Status = gBS->CheckEvent (TimerEvent3s);
} while (EFI_ERROR (Status));
gBS->CloseEvent (TimerEvent3s);
return Status;