Tasks

  • Tasks are implemented as functions with infinite loops.
  • Optional data can be passed to the function through the pdata pointer.
void task(void *pdata)
{
    while(1)
    {
        // Do work
    }
}

Task Stack

  • Each task requires a stack to be allocated before the task is created.
  • Allocations can be static or dynamic.
  • Static global
static OS_STK TaskOneStack[size];
  • Dynamic
    • Using malloc.
    • On another tasks stack if small and short lived.

Task States

../_images/Task_States.png

Table Of Contents

Previous topic

uCOS Start Functions

Next topic

uCOS Task Functions

This Page