RT-Thread RTOS
An open source embedded real-time operating system
|
Macros | |
#define | RT_VERSION_MAJOR 5 |
#define | RT_VERSION_MINOR 2 |
#define | RT_VERSION_PATCH 0 |
#define | RT_IS_ALIGN(addr, align) ((!(addr & (align - 1))) && (addr != RT_NULL)) |
#define | RT_ALIGN(size, align) (((size) + (align) - 1) & ~((align) - 1)) |
#define | RT_ALIGN_DOWN(size, align) ((size) & ~((align) - 1)) |
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.
#define RT_VERSION_MAJOR 5 |
Major version number (X.x.x)
#define RT_VERSION_MINOR 2 |
Minor version number (x.X.x)
#define RT_VERSION_PATCH 0 |
Patch version number (x.x.X)
#define RT_IS_ALIGN | ( | addr, | |
align | |||
) | ((!(addr & (align - 1))) && (addr != 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.
#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.
#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.