summaryrefslogtreecommitdiff
path: root/documentation/basic
diff options
context:
space:
mode:
authorMan, Jianting (Meco) <[email protected]>2022-12-11 13:12:03 -0500
committerGitHub <[email protected]>2022-12-11 13:12:03 -0500
commit99bdf978d7fe4ec18ed50a639e15b254825c871b (patch)
tree51ffb6f5fae10f2ce9a6baf4b861c025b8056fb6 /documentation/basic
parenta4b8762d8584b02a9b1f1c675a97ecaa105144be (diff)
[rtdef] use lower-case to define attributes (#6728)
* [rtdef] rename RT_WEAK attribute as rt_weak * [rtdef] rename RT_USED attribute as rt_used * [rtdef] rename RT_SECTION attribute as rt_section * [rtdef] rename ALIGN attribute as rt_align * [legacy] add RT_USED ALIGN RT_SECTION RT_WEAK as legacy support
Diffstat (limited to 'documentation/basic')
-rw-r--r--documentation/basic/basic.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/documentation/basic/basic.md b/documentation/basic/basic.md
index 25d8faa0d5..5beacacf83 100644
--- a/documentation/basic/basic.md
+++ b/documentation/basic/basic.md
@@ -715,10 +715,10 @@ Macro definitions are often used in RT-Thread. For example, some common macro de
#define rt_inline static __inline
```
-2)RT_USED,definition is as follows, the purpose of this macro is to explain to the compiler that this code is useful, compilation needs to be saved even if it is not called in the function. For example, RT-Thread auto-initialization uses custom segments, using RT_USED will retain custom code snippets.
+2)rt_used,definition is as follows, the purpose of this macro is to explain to the compiler that this code is useful, compilation needs to be saved even if it is not called in the function. For example, RT-Thread auto-initialization uses custom segments, using rt_used will retain custom code snippets.
```c
-#define RT_USED __attribute__((used))
+#define rt_used __attribute__((used))
```
3)RT_UNUSED,definition is as follows, indicates that a function or variable may not be used. This attribute prevents the compiler from generating warnings.
@@ -727,10 +727,10 @@ Macro definitions are often used in RT-Thread. For example, some common macro de
#define RT_UNUSED __attribute__((unused))
```
-4)RT_WEAK,definition is as follows, often used to define functions, when linking the function, the compiler will link the function without the keyword prefix first and link the function modified by weak if it can't find those functions.
+4)rt_weak,definition is as follows, often used to define functions, when linking the function, the compiler will link the function without the keyword prefix first and link the function modified by weak if it can't find those functions.
```c
-#define RT_WEAK __weak
+#define rt_weak __weak
```
5)ALIGN(n),definition is as follows, is used to align its stored address with n bytes when allocating an address space to an object. Here, n can be the power of 2. Byte alignment not only facilitates quick CPU access, but also save memory space if byte alignment is properly used.