RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
Basic Definitions

宏定义

#define RT_VERSION_MAJOR   5
 
#define RT_VERSION_MINOR   2
 
#define RT_VERSION_PATCH   0
 
#define RT_VERSION_CHECK(major, minor, revise)
 
#define RTTHREAD_VERSION   RT_VERSION_CHECK(RT_VERSION_MAJOR, RT_VERSION_MINOR, RT_VERSION_PATCH)
 
#define RT_IS_ALIGN(addr, align)
 
#define RT_ALIGN(size, align)
 
#define RT_ALIGN_DOWN(size, align)
 

详细描述

Basic data type in RT-Thread RTOS.

These are the basic definitions which used in RT-Thread RTOS. In general, RT-Thread kernel uses its own definition of the basic data types, such as rt_uint32_t, rt_uint8_t, etc., which does not depend on the compiler or architecture.

宏定义说明

◆ RT_VERSION_MAJOR

#define RT_VERSION_MAJOR   5

Major version number (X.x.x)

在文件 rtdef.h84 行定义.

◆ RT_VERSION_MINOR

#define RT_VERSION_MINOR   2

Minor version number (x.X.x)

在文件 rtdef.h85 行定义.

◆ RT_VERSION_PATCH

#define RT_VERSION_PATCH   0

Patch version number (x.x.X)

在文件 rtdef.h86 行定义.

◆ RT_VERSION_CHECK

#define RT_VERSION_CHECK ( major,
minor,
revise )
值:
((major * 10000U) + (minor * 100U) + revise)

在文件 rtdef.h89 行定义.

◆ RTTHREAD_VERSION

在文件 rtdef.h92 行定义.

◆ RT_IS_ALIGN

#define RT_IS_ALIGN ( addr,
align )
值:
((!(addr & (align - 1))) && (addr != RT_NULL))
#define RT_NULL

Return true(1) or false(0). RT_IS_ALIGN(128, 4) is judging whether 128 aligns with 4. The result is 1, which means 128 aligns with 4.

注解
If the address is NULL, false(0) will be returned

在文件 rtdef.h246 行定义.

◆ RT_ALIGN

#define RT_ALIGN ( size,
align )
值:
(((size) + (align) - 1) & ~((align) - 1))

Return the most contiguous size aligned at specified width. RT_ALIGN(13, 4) would return 16.

在文件 rtdef.h255 行定义.

◆ RT_ALIGN_DOWN

#define RT_ALIGN_DOWN ( size,
align )
值:
((size) & ~((align) - 1))

Return the down number of aligned at specified width. RT_ALIGN_DOWN(13, 4) would return 12.

在文件 rtdef.h264 行定义.