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.

Assigning instance names to static tasks?

Other Parts Discussed in Thread: SYSBIOS

Hello,

I am building as system that has a mix of static and dynamic tasks. For diagnostics, I want to be able to assign a name to each task so that it can be read using Task_Handle_name().

For dynamic tasks, the Task_Params structure for creation of the task includes an 'instance->name' field.

However, I can not figure out how to assign a name to the static functions and Task_Handle_name() returns the string {Empty instance name}.

Is there a way to assign an instance name to a static task? I would prefer to be able to set it statically in the .cfg file along with the rest of the task's properties.

Thanks

David Kelly

  • Hi David,

    You can assign names to static tasks as follows.

    var Task = xdc.useModule('ti.sysbios.knl.Task');
    var taskParams = new Task.Params();

    //set task params as necessary

    var tsk1 = Task.create('&tsk1_func', taskParams);
    tsk1.instance.name = "myTask";

    Regards,

    Shreyas