This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/CC2650STK: Task creating problem

Part Number: CC2650STK

Tool/software: TI C/C++ Compiler

Hi, Everyone


When I create a task in the way below, it works great

Void taskFxn(UArg arg0, UArg arg1)
{
     // coding here
}

int main(void)
{
    Board_initGeneral();

    /* Construct BIOS objects */
    Task_Params taskParams;
    Task_Params_init(&taskParams);
    taskParams.stackSize = TASKSTACKSIZE;
    taskParams.stack = &task0Stack;
    Task_construct(&task0Struct, (Task_FuncPtr)taskFxn, &taskParams, NULL);

    BIOS_start();

    return (0);
}



The next step i make task.c and task.h files. 

task.c file contains:

#include "task.h"

Void taskFxn(UArg arg0, UArg arg1)
{
     // coding here
}

task.h file contains:

Void taskFxn(UArg arg0, UArg arg1);

 
I edit the main file like this:

#include "task.h"

int main(void)
{
    Board_initGeneral();

    /* Construct BIOS objects */
    Task_Params taskParams;
    Task_Params_init(&taskParams);
    taskParams.stackSize = TASKSTACKSIZE;
    taskParams.stack = &task0Stack;
    Task_construct(&task0Struct, (Task_FuncPtr)taskFxn, &taskParams, NULL);

    BIOS_start();

    return (0);
}

An error occurs during compilation: unresolved symbol taskFxn, first referenced in ./main.obj

I need the task (taskFxn) to be located in its own file not in the main one. In the main.c tasks should only be launched. How can I achieve this?


Thank you in advance