##### Synopsis

    #include <ctl_api.h>
    void ctl_task_run(CTL_TASK_t *task,
                      unsigned char priority,
                      void (*entrypoint)(void *),
                      void *parameter,
                      char *name,
                      unsigned stack_size_in_words,
                      unsigned *stack,
                      unsigned call_size_in_words);

##### Description

This function takes a pointer in task to the CTL_TASK_t structure that represents the task. The priority can be 0 for the lowest priority up to 255 which is the highest. The entrypoint parameter is the function that the task will execute which has the parameter passed to it. The name is a pointer to a zero terminated string used for debug purposes. The start of the memory used to implement the stack that the task will execute in is stack and the size of the memory is supplied in stack_size_in_words. On systems that have two stacks (e.g. ATMEL AVR) then the call_size_in_words parameter must be set to specify the number of stack elements to use for the call stack.

##### Portability

ctl_task_run is provided in every implementation of the CrossWorks tasking library.