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.

Instance name to Idle Task

Other Parts Discussed in Thread: SYSBIOS

When a task is created, we add an instance name to that task using  TaskParam.instance.name = ".... " statement. Similarly, Is there a way to add an instance name to "ti.sysbios.knl.Task.IdleTask" in .cfg file?.

 

Thanks,

Rahul

  • Hi Rahul,

    I don't know whether it is possible to replace the instance name "ti.sysbios.knl.Task.IdleTask" assigned to the SYS/BIOS Idle Task since this instance is created internally by the Task module.  Why would you like to do this?  There may exist only a single Idle task, so the likelihood of confusing this Task with another one should be minor.

    Rregards,

    Shreyas

  • Hi Shreyas,

     

    Thank you for your reply. My application restricts to read only first 10 characters of the Task name. So, to have a meaningful name in my application I want to rename it with like "IdleTask".

     

    Thanks,

    Rahul

     

  • Rahul,
    that Task is created very late in the configuration step, so you can't change its name in your config script. Then, at the runtime you can get a handle to any static instance but you can't change its name. I am posting the code that can get you a reference to the Task instance you are looking for, in case you can do something useful with it to overcome a long and unchangeable name. BTW, the functions I am using are documented here.

    Int i;
    Task_Handle tsk;

    for (i = 0; i < Task_Object_count(); i++) {
       
    tsk = Task_Object_get(
    NULL, i);
       
    if (strcmp(Task_Handle_name(tsk), "ti.sysbios.knl.Task.IdleTask") == 0) {
            break;
        }
    }

  • Rahul, just to add to Sasha's suggestion above, you can also use the Task_getIdleTask() function to specifically get a handle to the Idle task.

    Regards,

    Shreyas

  •  

    Sasha and Shreyas,

    Thank you both for your replies. I am also thinking of doing string comparison and renaming with "IdleTask". I guess this will work for my application.

     

    Thanks,

    Rahul