Tool/software: TI-RTOS
Is it possible to have multiple instance of a tasks in TI-RTOS?
If yes, how to configure no. of instances for a task?
Application have a requirement where a task code shall be running for 5 different parameters simultaneously.
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.
Tool/software: TI-RTOS
Is it possible to have multiple instance of a tasks in TI-RTOS?
If yes, how to configure no. of instances for a task?
Application have a requirement where a task code shall be running for 5 different parameters simultaneously.
This will create 5 tasks with the entry point of myTask. That function can look at arg0 to see which one it is.
#define NUM_TASKS 5
Task_Handle taskHandle[NUM_TASKS];
main()
{
int i;
Task_Params taskParams;
Task_Params_init(&taskParams);
for (i = 0; i < NUM_TASKS; i++) {
taskParams.arg0 = i;
taskHandle[i] = Task_create((Task_FuncPtr)myTask, &taskParams, Error_IGNORE);
// error check to make sure taskHandle[i] is not NULL
}
...
}
Void myTask(UArg arg0, UArg arg1)
{
...
}