i have create a timer like this, and it work will, but when I want to create two timer work together, only one timer' call back function can work, please help, thanks:
EFI_STATUS TimerInit()
{
EFI_STATUS Status;
EFI_HANDLE TimerOne = NULL;
//BOOLEAN ExitMark = FALSE;
static const UINTN SecondsToNanoSeconds = 1000000;
Status = gBS->CreateEvent(
EVT_NOTIFY_SIGNAL | EVT_TIMER,
TPL_CALLBACK,
TimeoutSelf,
NULL,
&TimerOne
);
if ( EFI_ERROR( Status ) )
{
Print( L"Create Event Error! \r\n" );
return(1);
}
Status = gBS->SetTimer(
TimerOne,
TimerPeriodic,
MultU64x32( SecondsToNanoSeconds, 1)
);
if ( EFI_ERROR( Status ) )
{
Print( L"Set Timer Error! \r\n" );
return(2);
}
while (1 )
{
// do something
}
// cancel timer
gBS->SetTimer( TimerOne, TimerCancel, 0 );
gBS->CloseEvent( TimerOne );
return EFI_SUCCESS;
}
if I create two timer, I will create another TimeoutSelf function. too.