love_electronic
Member level 5
Hi guys
in a program i am unable to understand a function. Kindly help me to understand how it is working?
in a program at some point a function is called
Pit0CallBack will toggle an led
and a typedef is defined in a .h file like
Can you tell me what is the purpose of typedef void(*something)(void)? How does it works? from where to learn these kinds of functions?
How these routines are working?
in a program i am unable to understand a function. Kindly help me to understand how it is working?
in a program at some point a function is called
Code:
PIT_SetupCallBack(Pit0CallBack);
Code:
void PIT_SetupCallBack( T_PIT_Callback CallBack )
{
PIT_Callback[0] = CallBack;
}
Pit0CallBack will toggle an led
Code:
void Pit0CallBack(void)
{
/* toggle blue led, indicating PIT timer0 interrupt */
LED2_Toggle();
}
and a typedef is defined in a .h file like
Code:
typedef void (*T_PIT_Callback)(void);
Can you tell me what is the purpose of typedef void(*something)(void)? How does it works? from where to learn these kinds of functions?
How these routines are working?