• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Function passing through Pointer

    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
 

EE World Online Articles

Loading

 
Top