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 called from SWI in DSP/BIOS 5.41



Hello,

I want to activated TSK_func in SWI; I referred to slice example. But a new problem occurred:TSK_func cannot be called.

My codes are as follows:

void main()

{

     TSK_setpri(&TSK0,-1);                 //make TSK0 to suspended

}

void prd_func()

{

         ...............................    

        SWI_post(&SWI0);

}

void swi0_func()

{  

       ................

     TSK_setpri(&TSK0,4);               //set TSK0 priority to 4

     sem_post(&sem);

}

void TSK0_func(Arg id_arg)

{

     for(;;)

    {

         .......................

       SEM_pend(&sem, SYS_FOREVER);

    }

}

The results of the above code are as follows:

1. execute TSK0_func after main,  while not execute prd_func after main, however, I set the priority of TSK0 to -1;

2. TSK0_func only executed once, however, I call TSK0_func in SWI0_func using SEM_post(&sem);

Also I want to call several TSK_func in TSK0_func, how should I do?