- Blog entry posted in 'Function passing through pointer', October 21, 2013.
MY code is
Code:
typedef struct //typedef data struct
{
void (code * pTask)(void);
tWord pTask;
tWord Delay;
tWord Period;
tByte RunMe;
} SCH_tasks_G;
//==============================================
void main()
{
while(1)
{
SCH_Add_Task(CLOCK_LED,100,10);
}
}
//============================================================
tByte SCH_Add_Task(void(*pFunction)(),const tWord DELAY,const tWord PERIOD)
{
tByte Index = 0;
Index++;
}
//=============================================
void CLOCK_LED(void)
{
tByte i;
i=1;
}
when I complied above code with MPLAB IDC, then it gives an error like "main.c:50:Error: syntax error"Comments