Functions for managing tasks.
More...
|
typedef void(* | task_main_t )(void *p_context) |
| Main function of the task.
|
|
typedef uint8_t | task_id_t |
| Task ID.
|
|
Functions for managing tasks.
Create new task.
- Parameters
-
[in] | task | Function which become main procedure of new task. |
[in] | p_task_name | Task name. |
[in] | p_context | Context passed to task procedure. |
- Returns
- ID of the task on success, otherwise TASK_ID_INVALID.
void task_events_set |
( |
task_id_t |
task_id, |
|
|
uint32_t |
evt_mask |
|
) |
| |
Set events for given task.
- Parameters
-
[in] | task_id | Id of the task which shall receive events. |
[in] | evt_mask | Events for the task. |
uint32_t task_events_wait |
( |
uint32_t |
evt_mask | ) |
|
Wait for events. Set events are cleared after this function returns.
- Parameters
-
[in] | evt_mask | Mask of events to wait |
- Returns
- Mask with set events (can be a subset of evt_mask).
Complete current task.
Task stack returns to the pool of available stacks.
Returns ID of currently running task.
- Returns
- ID of active task.
void task_manager_start |
( |
task_main_t |
idle_task, |
|
|
void * |
p_idle_task_context |
|
) |
| |
Start task manager.
This function starts the task manager and configures given function as idle task. This function never returns.
- Parameters
-
[in] | idle_task | Main function of the task scheduled when no other tasks could be run. |
[in] | p_idle_task_context | Context passed to idle task. |
char const* task_name_get |
( |
task_id_t |
task_id | ) |
|
Set events for given task.
- Parameters
-
[in] | task_id | Id of the task which name will be returned. |
- Returns
- Task name
uint32_t task_stack_max_usage_get |
( |
task_id_t |
task_id | ) |
|
Returns maximum depth of task stack.
- Parameters
-
- Returns
- Number of bytes ever used on task stack.