OSA : OS_Task_GetCur

OST_TASK_POINTER OS_Task_GetCur ()

Allowed only in task

Get pointer to task control block (OST_TASK_POINTER) of current task. This pointer can be used in services that control the task indirectly (OS_Task_Pause, OS_Task_Continue, etc). Usually this service is called at the beginning of the task-function.

Call allowed:

Only in task

Parameters:

None

Returns:

OST_TASK_POINTER Pointer to current task's descriptor

Example:

OST_TASK_POINTER tp_Task;
void Task (void)
{
    tp_Task = OS_Task_GetCur();
    for (;;) {
        /*...*/
    }
}

See also