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.

API to Suspend and resume for the constructed task

Hi,

From documentation, i can only find the API's like Task_construct, Task_Create, Task_Destruct, Task_delete. And i could not find anything releated to suspend and resume of already created or constructed task.

My requirement is to suspend my task for sometime and then resume up on interrupt. currently i am using task delete or task destruct to stop executing the task and then use task create or task construct up on interupt to make the task run again. but i don't think these API's will work like suspend and Resume of already existing task.

can you please suggest on this!

thanks.

  • Hi Anil,

    If you want to delay for a certain amount of time, the Task_sleep(n) API can be used to delay the execution of a task for n-amount of clock ticks. Other tasks waiting for execution can run at this time, otherwise the Idle loop will run.

    If you want to block task execution until certain conditions in your application are met, the kernel has multiple objects like Semaphores, Events, Mailboxes on which a Task can pend until another task releases the resource or triggers the event. It would be worthwhile to read API documentation for the aforementioned objects.

    For example, your Task can pend on a semaphore (execution blocked), the Hwi can post the semaphore and unblock the Task. The Task will continue execution once the ISR is complete (assuming there are no other higher priority tasks waiting).

    Hope this helps,

    -- Emmanuel