|
| << Previous | Next >> |
INT8U OSTaskCreate(void (*task)(), void *pdata, INT16U stk_size, INT8U prio);
Description
- Creates a task to be managed by µC/OS-II. Tasks can either be created prior to the start of multitasking or by a running task. A task cannot be created by an ISR.
Parameters
void Task (void *pdata){for (;;) { Task code ;} }
- task
- Pointer to the task's starting address.
- pdata
- Pointer to an optional data area that can be used to pass parameters to the task when the task first executes. Where the task is concerned it thinks it was invoked and passed the argument "pdata" as follows:
- stk_size
- Number of bytes of the stack.
- prior
- Task's priority number. A unique priority ( 0-62 ) MUST be assigned to each task. The lower the number, the higher the priority (63 is for idle task).
Return value
- OS_NO_ERR
- The call was successful.
- OS_PRIO_EXIT
- Task priority already exists (each task MUST have a unique priority).
- OS_PRIO_INVALID
- The priority specified is higher than the maximum allowed (i.e. ≥
OS_LOWEST_PRIO).
Library
- OS_TASK.C
See also
- OSTaskCreateExt
| 020-0059 Rev. D | << Previous | Next >> | µC/OS-II |