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.

TSK_create

Expert 1005 points


Hello,

 I have the following code:

#include <std.h>
#include <stdio.h>
#include <log.h>
#include <tsk.h>
#include "Configuration1cfg.h"

void Task1(Arg arg1);
void main()
{

 TSK_Handle task;
 TSK_Attrs Attr;
 
 printf("program started\n");
 Attr= TSK_ATTRS;
 Attr.priority=15;
 Attr.stacksize=1024;

 task=TSK_create((Fxn)Task1,&Attr);
 
}

void Task1(Arg arg1)
{

 int i;
 for(i=0;i<100;i++)
 {
  printf("In task %d\n",i);
 }
}

But it doesn't create the task dynamically. TSK_create returns a null handle and the task never calls.

What is the problem and how can I solve it? Is there any sample on how to create a task dynamically?

Please note that I create the task statically then the program works.

Best regards