UINT32 LOS_CurTaskPriSet ( UINT16  usTaskPrio  ) 

Set the priority of the current running task to a specified priority.

Description:
This API is used to set the priority of the current running task to a specified priority.
注意:
  • Changing the priority of the current running task probably causes task scheduling.
  • Using the interface to change the priority of software timer task and idle task is not allowed.
  • Using the interface in the interrupt is not allowed.
参数:
参数名称 描述
usTaskPrio  [IN] Type UINT16 Task priority.
返回值:
返回值 描述
LOS_ERRNO_TSK_PRIOR_ERROR  Incorrect task priority.Re-configure the task priority
LOS_ERRNO_TSK_OPERATE_IDLE  Check the task ID and do not operate on the idle task.
LOS_ERRNO_TSK_ID_INVALID  Invalid Task ID
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.
Dependency:
  • los_task.h: the header file that contains the API declaration.
参见:
LOS_TaskPriGet
自从:
Huawei LiteOS V100R001C00