how to create a blocked task using processor expert

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to create a blocked task using processor expert

387 Views
hunglam
Contributor II

Hi, a quick question.. how can I create a blocked task using processor expert? if it cannot be done, how can I modify the task created by processor expert to a  blocked task? thanks

0 Kudos
1 Reply

274 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi lam:

I think you can use the API  _task_block() to block the active task. The API removes the active task from the task's ready queue and sets the BLOCKED bit in the STATE field of the task descriptor. Please see the following task

void world_task

   (

      uint32_t initial_data

   )

{

   _task_id hello_task_id;

   hello_task_id = _task_create(0, HELLO_TASK, 0);

   if (hello_task_id == MQX_NULL_TASK_ID) {

      printf ("\n Could not create hello_task\n");

   } else {

      printf(" World 3000 \n");

   }

   _task_block();

}

Regards

Daniel

0 Kudos