| #define LOS_ERRNO_TSK_ACTIVE_FAILED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x19) |
Task error code: The task fails to be activated.
Value: 0x03000219.
Solution: Perform task switching after creating an idle task.
| #define LOS_ERRNO_TSK_ALREADY_SUSPENDED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x08) |
Task error code: The task is already suspended.
Value: 0x02000208.
Solution: Suspend the task after it is resumed.
| #define LOS_ERRNO_TSK_CONFIG_TOO_MANY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1a) |
Task error code: Too many task configuration items.
Value: 0x0200021a
Solution: This error code is not in use temporarily.
| #define LOS_ERRNO_TSK_CP_SAVE_AREA_NOT_ALIGN LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1b) |
Task error code: This error code is not in use temporarily.
Value: 0x0200021b
| #define LOS_ERRNO_TSK_CP_SAVE_AREA_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1e) |
Task error code: This error code is not in use temporarily.
Value: 0x0200021e
| #define LOS_ERRNO_TSK_CPU_AFFINITY_MASK_ERR LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x23) |
Task error code: The cpu affinity mask is incorrect.
Value: 0x03000223.
Solution: Please set the correct cpu affinity mask.
| #define LOS_ERRNO_TSK_DELAY_IN_INT LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x0d) |
Task error code: The task delay occurs during an interrupt.
Value: 0x0300020d.
Solution: Perform this operation after exiting from the interrupt.
| #define LOS_ERRNO_TSK_DELAY_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0e) |
Task error code: The task delay occurs when the task is locked.
Value: 0x0200020e.
Solution: Perform this operation after unlocking the task.
| #define LOS_ERRNO_TSK_DELETE_LOCKED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x0b) |
Task error code: The task is locked when it is being deleted.
Value: 0x0300020b.
Solution: Unlock the task.
| #define LOS_ERRNO_TSK_ENTRY_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x04) |
Task error code: The task entrance is NULL.
Value: 0x02000204.
Solution: Define the task entrance function.
| #define LOS_ERRNO_TSK_FREE_STACK_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x17) |
Task error code: The task stack fails to be freed.
Value: 0x02000217
Solution: This error code is not in use temporarily.
| #define LOS_ERRNO_TSK_HOOK_IS_FULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x13) |
Task error code: The number of task hook functions exceeds the permitted upper limit.
Value: 0x02000213.
Solution: This error code is not in use temporarily.
| #define LOS_ERRNO_TSK_HOOK_NOT_MATCH LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x12) |
Task error code: The task hook function is not matchable.
Value: 0x02000212.
Solution: This error code is not in use temporarily.
| #define LOS_ERRNO_TSK_ID_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x07) |
Task error code: Invalid task ID.
Value: 0x02000207.
Solution: Check the task ID.
| #define LOS_ERRNO_TSK_MP_SYNC_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x26) |
Task error code: Task sync failed on operating running task across cores.
Value: 0x02000226.
Solution: Check task delete can be handled in user's scenario.
| #define LOS_ERRNO_TSK_MP_SYNC_RESOURCE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x25) |
Task error code: Task sync resource (semaphore) allocated failed.
Value: 0x02000225.
Solution: Expand LOSCFG_BASE_IPC_SEM_LIMIT.
| #define LOS_ERRNO_TSK_MSG_NONZERO LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0c) |
Task error code: The task message is nonzero.
Value: 0x0200020c.
Solution: This error code is not in use temporarily.
| #define LOS_ERRNO_TSK_MSG_Q_TOO_MANY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1d) |
Task error code: This error code is not in use temporarily.
Value: 0x0200021d
| #define LOS_ERRNO_TSK_NAME_EMPTY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x05) |
Task error code: The task name is NULL.
Value: 0x02000205.
Solution: Set the task name.
| #define LOS_ERRNO_TSK_NO_MEMORY LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x00) |
Task error code: Insufficient memory for task creation.
Value: 0x03000200.
Solution: Allocate bigger memory partition to task creation.
| #define LOS_ERRNO_TSK_NOT_CREATED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0a) |
Task error code: The task is not created.
Value: 0x0200020a.
Solution: Create the task.
| #define LOS_ERRNO_TSK_NOT_SUSPENDED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x09) |
Task error code: The task is not suspended.
Value: 0x02000209.
Solution: Suspend the task.
| #define LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x14) |
Task error code: The operation is performed on the system-level task. old usage: The operation is performed on the idle task (LOS_ERRNO_TSK_OPERATE_IDLE)
Value: 0x02000214.
Solution: Check the task ID and do not operate the system-level task.
| #define LOS_ERRNO_TSK_PRIOR_ERROR LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x03) |
Task error code: Incorrect task priority.
Value: 0x02000203.
Solution: Re-configure the task priority by referring to the priority range.
| #define LOS_ERRNO_TSK_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x01) |
Task error code: Null parameter.
Value: 0x02000201.
Solution: Check the parameter.
| #define LOS_ERRNO_TSK_SELF_DELETE_ERR LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1f) |
Task error code: This error code is not in use temporarily.
Value: 0x0200021f
| #define LOS_ERRNO_TSK_STKAREA_TOO_SMALL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x18) |
Task error code: The task stack area is too small.
Value: 0x02000218
Solution: This error code is not in use temporarily.
| #define LOS_ERRNO_TSK_STKSZ_NOT_ALIGN LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x02) |
Task error code: The task stack is not aligned.
Value: 0x02000202.
Solution: Align the task stack.
| #define LOS_ERRNO_TSK_STKSZ_TOO_LARGE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x20) |
Task error code: The task stack size is too large.
Value: 0x02000220.
Solution: shrink the task stack size parameter.
| #define LOS_ERRNO_TSK_STKSZ_TOO_SMALL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x06) |
Task error code: The task stack size is too small.
Value: 0x02000206.
Solution: Expand the task stack.
| #define LOS_ERRNO_TSK_SUSPEND_LOCKED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x15) |
Task error code: The task that is being suspended is locked.
Value: 0x03000215.
Solution: Suspend the task after unlocking the task.
| #define LOS_ERRNO_TSK_SUSPEND_SWTMR_NOT_ALLOWED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x21) |
Task error code: Suspending software timer task is not allowed.
Value: 0x02000221.
Solution: Check the task ID and do not suspend software timer task.
| #define LOS_ERRNO_TSK_TCB_UNAVAILABLE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x11) |
Task error code: No free task control block is available.
Value: 0x02000211.
Solution: Increase the number of task control blocks.
| #define LOS_ERRNO_TSK_YIELD_IN_INT LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x24) |
Task error code: Task yield in interrupt is not permited, which will result in an unexpected result.
Value: 0x02000224.
Solution: Don't call LOS_TaskYield in Interrupt.
| #define LOS_ERRNO_TSK_YIELD_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0f) |
Task error code: The task yield occurs when the task is locked.
Value: 0x0200020f.
Solution: Check the task.
| #define LOS_ERRNO_TSK_YIELD_NOT_ENOUGH_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x10) |
Task error code: Only one task or no task is available for scheduling.
Value: 0x02000210.
Solution: Increase the number of tasks.
| #define LOS_TASK_MIN_STACK_SIZE (ALIGN(LOSCFG_TASK_MIN_STACK_SIZE, LOSCFG_STACK_POINT_ALIGN_SIZE)) |
Minimum stack size.
LOSCFG_TASK_MIN_STACK_SIZE bytes, configured in menuconfig. LOS_TASK_MIN_STACK_SIZE bytes, aligned on a boundary of LOSCFG_STACK_POINT_ALIGN_SIZE.
| #define LOS_TASK_NAMELEN 32 |
Task name length
| #define LOS_TASK_STATUS_DETACHED 0x0100U |
Flag that indicates the task or task control block status. LOS_TASK_STATUS_DETACHED means the task is in the auto-deleted state. In this state, the task will be deleted automatically after the task is done.
Define the type of a task entrance function.
| param1 | [IN] Type UINTPTR The first parameter passed to the task handling function. |
| param2 | [IN] Type UINTPTR The second parameter passed to the task handling function. |
| param3 | [IN] Type UINTPTR The third parameter passed to the task handling function. |
| param4 | [IN] Type UINTPTR The fourth parameter passed to the task handling function. |
| None. |
| typedef struct tagTskInfo TSK_INFO_S |
Task information structure.
| typedef struct tagTskInitParam TSK_INIT_PARAM_S |
Define the structure of the parameters used for task creation.
Information of specified parameters passed in during task creation.
| typedef VOID(* TSKSWITCHHOOK)(VOID) |
Define the type of the task switching hook function.
| None. |
| None. |
Obtain current running task ID.
| LOS_ERRNO_TSK_ID_INVALID | Can not get current running task. |
| UINT32 | Task ID. |
| UINT32 LOS_CurTaskPriSet | ( | UINT16 | taskPrio | ) |
Set the priority of the current running task to a specified priority.
| taskPrio | [IN] Type UINT16 Task priority. |
| LOS_ERRNO_TSK_PRIOR_ERROR | Incorrect task priority.Re-configure the task priority. |
| LOS_ERRNO_TSK_ID_INVALID | The current task ID is invalid. |
| LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK | The current task is a system-level task, like idle or swtmr task. This is not allowed. |
| LOS_ERRNO_TSK_NOT_CREATED | The task is not created. |
| LOS_OK | The priority of the current running task is successfully set to a specified priority. |
| UINT16 LOS_TaskCpuAffiGet | ( | UINT32 | taskId | ) |
Get the affinity mask of the task scheduling cpu.
| taskId | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
| 0 | Fail to obtain the cpu affinity mask. |
| UINT16 | The scheduling cpu mask. The low to high bit of the mask corresponds to the cpu number. |
| UINT32 LOS_TaskCpuAffiSet | ( | UINT32 | taskId, |
| UINT16 | usCpuAffiMask | ||
| ) |
Set the affinity mask of the task scheduling cpu.
| taskId | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
| usCpuAffiMask | [IN] Type UINT16 The scheduling cpu mask.The low to high bit of the mask corresponds to the cpu number, the high bit that exceeding the CPU number is ignored. |
| LOS_ERRNO_TSK_ID_INVALID | Invalid task ID. |
| LOS_ERRNO_TSK_NOT_CREATED | The task is not created. |
| LOS_ERRNO_TSK_CPU_AFFINITY_MASK_ERR | The task cpu affinity mask is incorrect. |
| LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK | The task is system task. |
| LOS_OK | The task cpu affinity mask is successfully set. |
| UINT32 LOS_TaskCreate | ( | UINT32 * | taskId, |
| TSK_INIT_PARAM_S * | initParam | ||
| ) |
Create a task.
| taskId | [OUT] Type UINT32 * Task ID. |
| initParam | [IN] Type TSK_INIT_PARAM_S * Parameter for task creation. |
| LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID, param taskId is NULL. |
| LOS_ERRNO_TSK_PTR_NULL | Param initParam is NULL. |
| LOS_ERRNO_TSK_NAME_EMPTY | The task name is NULL. |
| LOS_ERRNO_TSK_ENTRY_NULL | The task entrance is NULL. |
| LOS_ERRNO_TSK_PRIOR_ERROR | Incorrect task priority. |
| LOS_ERRNO_TSK_STKSZ_TOO_LARGE | The task stack size is too large. |
| LOS_ERRNO_TSK_STKSZ_TOO_SMALL | The task stack size is too small. |
| LOS_ERRNO_TSK_TCB_UNAVAILABLE | No free task control block is available. |
| LOS_ERRNO_TSK_NO_MEMORY | Insufficient memory for task creation. |
| LOS_OK | The task is successfully created. |
| UINT32 LOS_TaskCreateOnly | ( | UINT32 * | taskId, |
| TSK_INIT_PARAM_S * | initParam | ||
| ) |
Create a task and suspend.
| taskId | [OUT] Type UINT32 * Task ID. |
| initParam | [IN] Type TSK_INIT_PARAM_S * Parameter for task creation. |
| LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID, param taskId is NULL. |
| LOS_ERRNO_TSK_PTR_NULL | Param initParam is NULL. |
| LOS_ERRNO_TSK_NAME_EMPTY | The task name is NULL. |
| LOS_ERRNO_TSK_ENTRY_NULL | The task entrance is NULL. |
| LOS_ERRNO_TSK_PRIOR_ERROR | Incorrect task priority. |
| LOS_ERRNO_TSK_STKSZ_TOO_LARGE | The task stack size is too large. |
| LOS_ERRNO_TSK_STKSZ_TOO_SMALL | The task stack size is too small. |
| LOS_ERRNO_TSK_TCB_UNAVAILABLE | No free task control block is available. |
| LOS_ERRNO_TSK_NO_MEMORY | Insufficient memory for task creation. |
| LOS_OK | The task is successfully created. |
| UINT32 LOS_TaskCreateOnlyStatic | ( | UINT32 * | taskId, |
| TSK_INIT_PARAM_S * | initParam, | ||
| VOID * | topStack | ||
| ) |
Create a task with User defines stack space and suspend .
| taskID | [OUT] Type UINT32 * Task ID. |
| taskInitParam | [IN] Type TSK_INIT_PARAM_S * Parameter for task creation. |
| topOfStack | [IN] Type VOID* Parameter for task's top of stack address. |
| LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID, param puwTaskID is NULL. |
| LOS_ERRNO_TSK_PTR_NULL | Param pstInitParam is NULL. |
| LOS_ERRNO_TSK_NAME_EMPTY | The task name is NULL. |
| LOS_ERRNO_TSK_ENTRY_NULL | The task entrance is NULL. |
| LOS_ERRNO_TSK_PRIOR_ERROR | Incorrect task priority. |
| LOS_ERRNO_TSK_STKSZ_TOO_LARGE | The task stack size is too large. |
| LOS_ERRNO_TSK_STKSZ_TOO_SMALL | The task stack size is too small. |
| LOS_ERRNO_TSK_TCB_UNAVAILABLE | No free task control block is available. |
| LOS_ERRNO_TSK_NO_MEMORY | Insufficient memory for task creation. |
| LOS_OK | The task is successfully created. |
| UINT32 LOS_TaskCreateStatic | ( | UINT32 * | taskId, |
| TSK_INIT_PARAM_S * | initParam, | ||
| VOID * | topStack | ||
| ) |
Create a task.
| taskID | [OUT] Type UINT32 * Task ID. |
| taskInitParam | [IN] Type TSK_INIT_PARAM_S * Parameter for task creation. |
| topOfStack | [IN] Type VOID * Parameter for task's top of stack address. |
| LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID, param puwTaskID is NULL. |
| LOS_ERRNO_TSK_PTR_NULL | Param pstInitParam is NULL. |
| LOS_ERRNO_TSK_NAME_EMPTY | The task name is NULL. |
| LOS_ERRNO_TSK_ENTRY_NULL | The task entrance is NULL. |
| LOS_ERRNO_TSK_PRIOR_ERROR | Incorrect task priority. |
| LOS_ERRNO_TSK_STKSZ_TOO_LARGE | The task stack size is too large. |
| LOS_ERRNO_TSK_STKSZ_TOO_SMALL | The task stack size is too small. |
| LOS_ERRNO_TSK_TCB_UNAVAILABLE | No free task control block is available. |
| LOS_ERRNO_TSK_NO_MEMORY | Insufficient memory for task creation. |
| LOS_OK | The task is successfully created. |
| UINT32 LOS_TaskDelay | ( | UINT32 | tick | ) |
Delay a task.
| tick | [IN] Type UINT32 Number of Ticks for which the task is delayed. |
| LOS_ERRNO_TSK_DELAY_IN_INT | The task delay occurs during an interrupt. |
| LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK | The current task is a system-level task, like idle or swtmr task. This is not allowed. |
| LOS_ERRNO_TSK_DELAY_IN_LOCK | The task delay occurs when the task scheduling is locked. |
| LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID |
| LOS_ERRNO_TSK_YIELD_NOT_ENOUGH_TASK | No tasks with the same priority is available for scheduling. |
| LOS_OK | The task is successfully delayed. |
| UINT32 LOS_TaskDelete | ( | UINT32 | taskId | ) |
Delete a task.
| taskId | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
| LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID |
| LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK | Check the task ID and do not operate the system-level task, like idle or swtmr task. |
| LOS_ERRNO_TSK_NOT_CREATED | The task is not created. |
| LOS_ERRNO_TSK_DELETE_LOCKED | The task being deleted is current task and task scheduling is locked. |
| LOS_OK | The task is successfully deleted. |
| UINT32 LOS_TaskInfoGet | ( | UINT32 | taskId, |
| TSK_INFO_S * | taskInfo | ||
| ) |
Obtain a task information structure.
| taskId | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
| taskInfo | [OUT] Type TSK_INFO_S* Pointer to the task information structure to be obtained. |
| LOS_ERRNO_TSK_PTR_NULL | Null parameter. |
| LOS_ERRNO_TSK_ID_INVALID | Invalid task ID. |
| LOS_ERRNO_TSK_NOT_CREATED | The task is not created. |
| LOS_OK | The task information structure is successfully obtained. |
| VOID LOS_TaskLock | ( | VOID | ) |
Lock the task scheduling.
| None. |
| None. |
| UINT16 LOS_TaskPriGet | ( | UINT32 | taskId | ) |
Obtain a task priority.
| taskId | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
| OS_INVALID | Fails to obtain the task priority. |
| UINT16 | The task priority. |
| UINT32 LOS_TaskPriSet | ( | UINT32 | taskId, |
| UINT16 | taskPrio | ||
| ) |
Set a task priority.
| taskId | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
| taskPrio | [IN] Type UINT16 Task priority. |
| LOS_ERRNO_TSK_PRIOR_ERROR | Incorrect task priority.Re-configure the task priority |
| LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID |
| LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK | Check the task ID and do not operate the system-level task, like idle or swtmr task. |
| LOS_ERRNO_TSK_NOT_CREATED | The task is not created. |
| LOS_OK | The priority of the current running task is successfully set to a specified priority. |
Recycle task stack resource.
| None. |
| None. |
| UINT32 LOS_TaskResume | ( | UINT32 | taskId | ) |
Resume a task.
| taskId | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
| LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID |
| LOS_ERRNO_TSK_NOT_CREATED | The task is not created. |
| LOS_ERRNO_TSK_NOT_SUSPENDED | The task is not suspended. |
| LOS_OK | The task is successfully resumed. |
| UINT32 LOS_TaskSuspend | ( | UINT32 | taskId | ) |
Suspend a task.
| taskId | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
| LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID |
| LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK | Check the task ID and do not operate the system-level task, like idle or swtmr task. |
| LOS_ERRNO_TSK_NOT_CREATED | The task is not created. |
| LOS_ERRNO_TSK_ALREADY_SUSPENDED | The task is already suspended. |
| LOS_ERRNO_TSK_SUSPEND_LOCKED | The task being suspended is current task and task scheduling is locked. |
| LOS_OK | The task is successfully suspended. |
| VOID LOS_TaskSwitchHookReg | ( | TSKSWITCHHOOK | hook | ) |
User task switching hook function.
| hook | [IN] Type TSKSWITCHHOOK. The user defined hook for task switch. |
| None. |
| VOID LOS_TaskUnlock | ( | VOID | ) |
Unlock the task scheduling.
| None. |
| None. |
| UINT32 LOS_TaskYield | ( | VOID | ) |
Change the scheduling sequence of tasks with the same priority.
| None. |
| LOS_ERRNO_TSK_YIELD_IN_INT | The task yield occurs during an interrupt. |
| LOS_ERRNO_TSK_YIELD_IN_LOCK | The task yield occurs when the task is locked. |
| LOS_ERRNO_TSK_ID_INVALID | The current task ID is invalid. |
| LOS_ERRNO_TSK_YIELD_NOT_ENOUGH_TASK | No tasks with the same priority is available for scheduling. |
| LOS_OK | The scheduling sequence of tasks with same priority is successfully changed. |