Hi.
I wanto to suspend a task with vTaskSuspend and then call vTaskResumeFromISR.
My question is:
-my task calls some function and in that function there is a call to vTaskSuspend. But how can I now the xTaskHandle of that task in order to suspend it?
The task handle is returned as a parameter to the task create function.
Look at the file FreeRTOS\Demo\Common\Minimal\dynamic.c which contains an example. Search this file for the variable xContinousIncrementHandle, you will see it is of type xTaskHandle.
xContinousIncrementHandle is passed into xTaskCreate by reference. Following the call to xTaskCreate it contains the task handle.
I want to suspend a task with vTaskSuspend, and call vTaskResumeFromISR to resume it from an interrupt.
To call vTaskSuspend and vTaskResumeFromISR I think I need to know the xTaskHandle. If I am wrong please explain…
Here is what I want do do:
static xTaskHandle xHandle;
void DoSomething (void)
{
// Get resource semaphore with xSemaphoreTake
// I must get the xHandle from current task here…
// Use the xHandle to suspend the created task.
vTaskSuspend( xHandle );
// Release resource semaphore with xSemaphoreGive
}