WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
Basic definitions
Basic definitions 的协作图:

宏定义

#define LOS_ASSERT_COND(expression)   LOS_ASSERT(expression)
 Assertion.
 
#define LOS_NO_WAIT   0
 
#define LOS_WAIT_FOREVER   0xFFFFFFFF
 
#define ALIGN(addr, boundary)   LOS_Align(addr, boundary)
 Align the value (addr) by some bytes (boundary).
 
#define TRUNCATE(addr, size)   ((UINTPTR)(addr) & ~((size) - 1))
 Align the value (addr) by some bytes (size).
 
#define LOS_ASSERT(judge)
 Assertion.
 

函数

UINTPTR LOS_Align (UINTPTR addr, UINT32 boundary)
 Align the address (addr) by some bytes (boundary) you specify.
 
void LOS_Msleep (UINT32 msecs)
 Sleep the current task.
 

详细描述

宏定义说明

◆ ALIGN

#define ALIGN (   addr,
  boundary 
)    LOS_Align(addr, boundary)

Align the value (addr) by some bytes (boundary).

Description:
Align the beginning of the object with the base address, with boundary bytes being the smallest unit of alignment. The ALIGN function is same with LOS_Align function.
注意
  • the value of boundary usually is 4,8,16,32.
  • users should avoid overflows due to alignment.
参数
addr[IN] Type UINTPTR The address you want to align.
boundary[IN] Type UINT32 The alignment size.
返回值
UINTPTRThe address which have been aligned.
Dependency:
  • los_base.h: the header file that contains the API declaration.
参见
LOS_Align | TRUNCATE
自从
Huawei LiteOS V100R001C00

◆ LOS_ASSERT

#define LOS_ASSERT (   judge)

Assertion.

Description:
When the program runs to the assertion position, the corresponding expression should be true. If the expression is not true, the program stops running and gives an error message. The function is same with LOS_ASSERT_COND function.
注意
The function is effective only LOSCFG_DEBUG_VERSION is defined.
参数
judge[IN] The judgement expression of the assertion.
返回值
None.
Dependency:
  • los_base.h: the header file that contains the API declaration.
参见
LOS_ASSERT_COND
自从
Huawei LiteOS V100R001C00

◆ LOS_ASSERT_COND

#define LOS_ASSERT_COND (   expression)    LOS_ASSERT(expression)

Assertion.

Description:
When the program runs to the assertion position, the corresponding expression should be true. If the expression is not true, the program stops running and gives an error message. The LOS_ASSERT_COND function is same with LOS_ASSERT function.
注意
The function is effective only LOSCFG_DEBUG_VERSION is defined.
参数
expression[IN] The judgement expression of the assertion.
返回值
None.
Dependency:
  • los_base.h: the header file that contains the API declaration.
参见
LOS_ASSERT
自从
Huawei LiteOS V100R001C00

◆ LOS_NO_WAIT

#define LOS_NO_WAIT   0

Define the timeout interval as LOS_NO_WAIT.

◆ LOS_WAIT_FOREVER

#define LOS_WAIT_FOREVER   0xFFFFFFFF

Define the timeout interval as LOS_WAIT_FOREVER.

◆ TRUNCATE

#define TRUNCATE (   addr,
  size 
)    ((UINTPTR)(addr) & ~((size) - 1))

Align the value (addr) by some bytes (size).

Description:
Align the tail of the object with the base address, with size bytes being the smallest unit of alignment.
注意
  • the value of size usually is 4,8,16,32.
  • users should avoid overflows due to alignment.
参数
addr[IN] Type UINTPTR The address you want to align.
size[IN] Type UINT32 The alignment size.
返回值
UINTPTRThe address which have been aligned.
Dependency:
  • los_base.h: the header file that contains the API declaration.
参见
LOS_Align | ALIGN
自从
Huawei LiteOS V100R001C00

函数说明

◆ LOS_Align()

UINTPTR LOS_Align ( UINTPTR  addr,
UINT32  boundary 
)
extern

Align the address (addr) by some bytes (boundary) you specify.

Description:
This API is used to align the address (addr) by some bytes (boundary) you specify.
注意
  • the value of boundary usually is 4,8,16,32.
  • users should avoid overflows due to alignment.
参数
addr[IN] Type UINTPTR The address you want to align.
boundary[IN] Type UINT32 The alignment size.
返回值
UINTPTRThe address which have been aligned.
Dependency:
  • los_base.h: the header file that contains the API declaration.
参见
ALIGN | TRUNCATE
自从
Huawei LiteOS V100R001C00

◆ LOS_Msleep()

void LOS_Msleep ( UINT32  msecs)
extern

Sleep the current task.

Description:
This API is used to delay the execution of the current task. The task is able to be scheduled after it is delayed for a specified milliseconds.
注意
  • The task fails to be delayed if it is being delayed during interrupt processing or it is locked.
  • If 0 is passed in and the task scheduling is not locked, execute the next task in the queue of tasks with the priority of the current task. If no ready task with the priority of the current task is available, the task scheduling will not occur, and the current task continues to be executed.
  • The parameter passed in can not be equal to LOS_WAIT_FOREVER(0xFFFFFFFF). If that happens, the task will not sleep 0xFFFFFFFF milliseconds or sleep forever but sleep 0xFFFFFFFF Ticks.
  • This API is not an accurate delay function. The actual delay time is longer than that of parameter msecs.
参数
msecs[IN] Type UINT32 Milliseconds for which the task is delayed.
返回值
None
Dependency:
  • los_base.h: the header file that contains the API declaration.
参见
LOS_Mdelay | LOS_TaskDelay
自从
Huawei LiteOS V100R001C00