AnsweredAssumed Answered

MQX lite suspend tasks

Question asked by Daniele Cortellazzi on Nov 3, 2014
Latest reply on Nov 7, 2014 by Radek Sestak

Hi,

 

i have a problem with MQX lite. I have an interrupt that occure when i connect the usb cable. When i connect the usb i have to block two task and activate one other, when i disconnect the cable i have to block this task and re-activate the other two. Mi code is this:

 

 

if (USB_ID_GetVal(NULL)) {//se usb collegata

  flag_usb=1;

  _task_abort(task_LCD);

  _task_abort(task_CLOCK);

  } else {//altrimenti

  error = _task_abort(task_USB);

  _task_restart(task_LCD, NULL, 0);

  _task_restart(task_CLOCK, NULL, 0);

  }

 

 

the problem is that if i call the _task_abort i can't restart this, what is the best function for block the task in a ISR? I have seen that i can't use the _task_block function. I have to remove the two task from the queue of execution. Thanks

Outcomes