Skip to content

Commit 46cf91c

Browse files
committed
doxygen: convert 7.contribution
Signed-off-by: Chen Wang <[email protected]>
1 parent fe808e5 commit 46cf91c

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

documentation/7.contribution/INDEX.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
We sincerely thank you for your contribution, and welcome to submit the code through GitHub's fork and Pull Request processes. RT-Thread 3.1.0 version and its earlier versions follow the GPL V2 open source license agreement. Versions from the 3.1.0 version onwards follow the Apache License 2.0 open source license agreement.
66

77
All the real-time operating system kernel and open source components can be used free of charge for commercial products, there is no potential commercial risk and you will not being request to publish application source.
8+
9+
@subpage rtt_code_style_en

documentation/Doxyfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,8 @@ RECURSIVE = YES
916916
EXCLUDE = ./0.doxygen/mainpage.h \
917917
./README.md \
918918
./2.quick-start/quick_start_qemu \
919-
./env/env-vscode.md
919+
./env/env-vscode.md \
920+
./contribution_guide/coding_style_cn.md
920921

921922
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
922923
# directories that are symbolic links (a Unix file system feature) are excluded

documentation/INDEX.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@
4848
- @ref component_pm
4949
- @ref component_network
5050

51+
@subpage code_contribution
52+

documentation/contribution_guide/coding_style_en.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RT-Thread Coding Style
1+
@page rtt_code_style_en RT-Thread Coding Style
22

33
This is an developing instruction for RT-Thread developers. As open source
44
software, RT-Thread is created by the cooperation of different people. This
@@ -7,22 +7,22 @@ RT-Thread users should also get to know some conventions in the code through it
77
and thus easier to understand the implementations of RT-Thread.
88

99

10-
1. Directory Naming
10+
# 1. Directory Naming
1111

1212
In normal conditions, please name directories in lowercase. Directories should
1313
have descriptive names. For example, the port of a chip should be composed of
1414
the name of the chip and the category of the chip. Directories under components/
1515
should name what the component does.
1616

1717

18-
2. File Naming
18+
# 2. File Naming
1919

2020
In normal conditions, please name files in lowercase. If the file is
2121
referencing other places, it can have the original name. To avoid naming
2222
collision, do not use general names or the names that are frequently used.
2323

2424

25-
3. Header Files
25+
# 3. Header Files
2626

2727
To avoid include the same header file for multiple times, you need to define a
2828
symbol like this:
@@ -36,7 +36,7 @@ The symbol should begin and end with "__" to avoid naming collision. The words
3636
of the file name should be connected by "_". (This convention is called "snake case".)
3737

3838

39-
4. Header File Comments
39+
# 4. Header File Comments
4040

4141
In every header file, there should be copyright information and Change Log
4242
record like this:
@@ -52,7 +52,7 @@ record like this:
5252
* 2006-04-26 Bernard add semaphore APIs
5353
*/
5454

55-
5. Structure Defines
55+
# 5. Structure Defines
5656

5757
Please name structures in lowercase and connect words with "_". For example:
5858

@@ -76,15 +76,15 @@ example:
7676
typedef struct rt_timer* rt_timer_t;
7777

7878

79-
6. Macros
79+
# 6. Macros
8080

8181
In RT-Thread, please use uppercase names for macro definitions. Words are
8282
connected by "_". Like:
8383

8484
#define RT_TRUE 1
8585

8686

87-
7. Function Naming and Declaration
87+
# 7. Function Naming and Declaration
8888

8989
Please name functions in lowercase. Separate words with "_". The API provided to
9090
upper application should be declared in header files. If the function don't have
@@ -93,15 +93,15 @@ parameters, it should be declared as void:
9393
rt_thread_t rt_thread_self(void);
9494

9595

96-
8. Commenting
96+
# 8. Commenting
9797

9898
Please use English to comment. There shouldn't be many comments as the
9999
comments should describe what the code does. It should describe complicated
100100
algorithms, for example. Comments for statements should be placed before the
101101
statements or to the right of them. Any other locations are invalid.
102102

103103

104-
9. Indent
104+
# 9. Indent
105105

106106
Please use TAB or 4 spaces to indent. It's preferred to use 4 spaces. If no
107107
other special meanings, the indent should begin right after "{":
@@ -123,7 +123,7 @@ aligned with "switch":
123123
"case" is aligned with "switch". The following code block should be indented.
124124

125125

126-
10. Braces and Spaces
126+
# 10. Braces and Spaces
127127

128128
For ease of reading, it is advised that braces should occupy the whole line
129129
instead of following other statements. Like:
@@ -160,7 +160,7 @@ operators and the strings. There should be no spaces around(inside) parentheses,
160160
This is a bad practice.
161161

162162

163-
11. trace, log Information
163+
# 11. trace, log Information
164164

165165
In RT-Thread, rt_kprintf is a commonly used logging routine. In RT-Thread
166166
rt_kprintf is implemented as a polling, non-interrupting string output. It is
@@ -175,14 +175,14 @@ variable or a macro). When logging, it should be easy to understand and easy to
175175
determine where the problem is.
176176

177177

178-
12. Functions
178+
# 12. Functions
179179

180180
Functions in kernel should be K.I.S.S. ("Keep it simple, stupid.") If the function
181181
is too long, you should split it into smaller ones, with each of them simplified to
182182
be easy to understand.
183183

184184

185-
13. Objects
185+
# 13. Objects
186186

187187
The kernel of RT-Thread uses object-oriented techniques in C. The naming convention
188188
is: structure names are the object names, object names + verb phrases are the
@@ -211,7 +211,7 @@ When creating a new object, think twice on memory allocations: whether a static
211211
object could be created or it could only created dynamically on the heap. Allocations
212212
can be slower, but may be necessary in dynamic environments.
213213

214-
14. Use astyle to format the code automatically
214+
# 14. Use astyle to format the code automatically
215215
parameters: --style=allman
216216
--indent=spaces=4
217217
--indent-preproc-block

0 commit comments

Comments
 (0)