daixiwen (http://www.alteraforum.com/forum/member.php?u=4443)
thanks for your reply!
underside is my program, could you do me a favor to figure out can the parameter i can be transfer to the called function my_alarm_callback?if can't,how can the parameter be transfer into this function?
Thank you very much!
alt_u32 my_alarm_callback (void* context)
{
/* This function will be called once/second */
*(alt_u8 *)context++;
return alt_ticks_per_second();
}
int main()
{
static alt_alarm alarm;
static alt_u8 i;
if (alt_alarm_start (&alarm,
alt_ticks_per_second(),
my_alarm_callback(&i),
NULL) < 0)
{
printf ("No system clock available\n");
}
else printf("alarm exist\n");
while(1)
{
if(i==1)
{printf("call happend\n");
i=0;}
}
}