Provides memory management functionality managing tasks (create, destroy, yield, etc.).
◆ MMOSAL_TASK_ENTER_CRITICAL
| #define MMOSAL_TASK_ENTER_CRITICAL |
( |
| ) |
|
Value: do { \
MMPORT_MEM_SYNC(); \
mmosal_task_enter_critical(); \
} while (0)
Enter critical section.
This may result in interrupts being disabled so critical sections must be kept short. Each entry to a critical section must be matched to a corresponding exit (MMOSAL_TASK_EXIT_CRITICAL()).
Definition at line 240 of file mmosal.h.
◆ MMOSAL_TASK_EXIT_CRITICAL
| #define MMOSAL_TASK_EXIT_CRITICAL |
( |
| ) |
|
Value: do { \
MMPORT_MEM_SYNC(); \
mmosal_task_exit_critical(); \
} while (0)
Exit critical section.
Used to exit a critical section previously entered with MMOSAL_TASK_ENTER_CRITICAL()).
Definition at line 251 of file mmosal.h.
◆ mmosal_task_fn_t
| typedef void(* mmosal_task_fn_t) (void *arg) |
Type definition for task main functions.
- Parameters
-
| arg | Opaque argument passed in at task creation. |
Definition at line 173 of file mmosal.h.
◆ mmosal_task_priority
Enumeration of task priorities (ordered lowest to highest).
| Enumerator |
|---|
| MMOSAL_TASK_PRI_IDLE | Idle task priority.
|
| MMOSAL_TASK_PRI_MIN | Minimum priority.
|
| MMOSAL_TASK_PRI_LOW | Low priority.
|
| MMOSAL_TASK_PRI_NORM | Normal priority.
|
| MMOSAL_TASK_PRI_HIGH | High priority.
|
Definition at line 176 of file mmosal.h.
◆ mmosal_disable_interrupts()
| void mmosal_disable_interrupts |
( |
void |
| ) |
|
◆ mmosal_enable_interrupts()
| void mmosal_enable_interrupts |
( |
void |
| ) |
|
◆ mmosal_task_create()
Create a new task.
- Parameters
-
| task_fn | Task main function. |
| argument | Argument to pass to main function. |
| priority | Task priority. |
| stack_size_u32 | Size of stack to allocate for task (in units of 32 bit words). |
| name | Name to give the task. |
- Returns
- an opaque task handle, or
NULL on failure.
◆ mmosal_task_delete()
| void mmosal_task_delete |
( |
struct mmosal_task * |
task | ) |
|
Delete the given task.
- Parameters
-
| task | Handle of the task to delete (or NULL to delete the current task). |
- Note
- With FreeRTOS deleted tasks will not be cleaned up until the idle task runs.
◆ mmosal_task_enter_critical()
| void mmosal_task_enter_critical |
( |
void |
| ) |
|
Enter critical section.
This may result in interrupts being disabled so critical sections must be kept short. Each entry to a critical section must be matched to a corresponding exit (mmosal_task_exit_critical()).
- Note
- This function should not be invoked directly. Use MMOSAL_TASK_ENTER_CRITICAL().
◆ mmosal_task_exit_critical()
| void mmosal_task_exit_critical |
( |
void |
| ) |
|
◆ mmosal_task_get_active()
| struct mmosal_task * mmosal_task_get_active |
( |
void |
| ) |
|
Get the handle of the active task.
- Returns
- the handle of the active task.
◆ mmosal_task_name()
| const char * mmosal_task_name |
( |
void |
| ) |
|
Get the name of the running task.
- Returns
- the name of the running task.
◆ mmosal_task_sleep()
| void mmosal_task_sleep |
( |
uint32_t |
duration_ms | ) |
|
Sleep for a period of time, yielding during that time.
- Parameters
-
| duration_ms | Sleep duration, in milliseconds. |