Skip to content

Commit f9e969b

Browse files
committed
doxygen: finsh: Normalize macro definitions
Regular macro definitions according to [1]. Link: https://rt-thread.github.io/rt-thread/page_howto_macro.html [1] Signed-off-by: Chen Wang <[email protected]>
1 parent 9677283 commit f9e969b

File tree

1 file changed

+44
-35
lines changed

1 file changed

+44
-35
lines changed

components/finsh/finsh.h

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ typedef long (*syscall_func)(void);
3636
#endif /* __TI_COMPILER_VERSION__ */
3737

3838
/**
39-
* Macro to export a command along with its name, description, and options to the symbol table in MSVC.
40-
* @param name The function name associated with the command.
41-
* @param cmd The command name.
42-
* @param desc The description of the command.
43-
* @param opt The options associated with the command, used for option completion.
39+
* @brief Macro to export a command along with its name, description, and options to the symbol table in MSVC.
40+
*
41+
* @param[in] name The function name associated with the command.
42+
* @param[in] cmd The command name.
43+
* @param[in] desc The description of the command.
44+
* @param[in] opt The options associated with the command, used for option completion.
4445
*/
4546
#ifdef _MSC_VER
4647
#define MSH_FUNCTION_EXPORT_CMD(name, cmd, desc, opt) \
@@ -90,7 +91,7 @@ typedef long (*syscall_func)(void);
9091
#endif /* FINSH_USING_SYMTAB */
9192

9293
/**
93-
* Macro definitions to simplify the declaration of exported functions or commands.
94+
* @brief Macro definitions to simplify the declaration of exported functions or commands.
9495
*/
9596
#define __MSH_GET_MACRO(_1, _2, _3, _FUN, ...) _FUN
9697
#define __MSH_GET_EXPORT_MACRO(_1, _2, _3, _4, _FUN, ...) _FUN
@@ -111,51 +112,56 @@ typedef long (*syscall_func)(void);
111112
/**
112113
* @ingroup group_finsh
113114
*
114-
* This macro exports a system function to finsh shell.
115+
* @brief This macro exports a system function to finsh shell.
115116
*
116-
* @param name the name of function.
117-
* @param desc the description of function, which will show in help.
117+
* @param[in] name Name of function.
118+
* @param[in] desc Description of function, which will show in help.
118119
*/
119120
#define FINSH_FUNCTION_EXPORT(name, desc)
120121

121122
/**
122123
* @ingroup group_finsh
123124
*
124-
* This macro exports a system function with an alias name to finsh shell.
125+
* @brief Exports a system function with an alias name to finsh shell.
125126
*
126-
* @param name the name of function.
127-
* @param alias the alias name of function.
128-
* @param desc the description of function, which will show in help.
127+
* @param[in] name Name of function.
128+
* @param[in] alias Alias name of function.
129+
* @param[in] desc Description of function, which will show in help.
129130
*/
130131
#define FINSH_FUNCTION_EXPORT_ALIAS(name, alias, desc)
131132

132133
/**
133134
* @ingroup group_finsh
134135
*
135-
* This macro exports a command to module shell.
136+
* @brief Exports a command to module shell.
137+
*
138+
* @param[in] command is the name of the command.
139+
* @param[in] desc is the description of the command, which will show in help list.
140+
* @param[in] opt This is an option, enter any content to enable option completion
136141
*
137-
* param command is the name of the command.
138-
* param desc is the description of the command, which will show in help list.
139-
* param opt This is an option, enter any content to enable option completion
142+
* @note This macro can be used in two ways:
143+
* @code MSH_CMD_EXPORT(command, desc) @endcode
144+
* or
145+
* @code MSH_CMD_EXPORT(command, desc, opt) @endcode
140146
*/
141-
/* MSH_CMD_EXPORT(command, desc) or MSH_CMD_EXPORT(command, desc, opt) */
142147
#define MSH_CMD_EXPORT(...) \
143148
__MSH_GET_MACRO(__VA_ARGS__, _MSH_FUNCTION_CMD2_OPT, \
144149
_MSH_FUNCTION_CMD2)(__VA_ARGS__)
145150

146151
/**
147152
* @ingroup group_finsh
148153
*
149-
* This macro exports a command with alias to module shell.
154+
* @brief Exports a command with alias to module shell.
155+
*
156+
* @param[in] command Name of the command.
157+
* @param[in] alias Alias of the command.
158+
* @param[in] desc Description of the command, which will show in help list.
159+
* @param[in] opt An option, enter any content to enable option completion.
150160
*
151-
* param command is the name of the command.
152-
* param alias is the alias of the command.
153-
* param desc is the description of the command, which will show in help list.
154-
* param opt This is an option, enter any content to enable option completion
155-
* @code
156-
* #define MSH_CMD_EXPORT_ALIAS(command, alias, desc) or
157-
* #define MSH_CMD_EXPORT_ALIAS(command, alias, desc, opt)
158-
* @endcode
161+
* @note This macro can be used in two ways:
162+
* @code #define MSH_CMD_EXPORT_ALIAS(command, alias, desc) @endcode
163+
* or
164+
* @code #define MSH_CMD_EXPORT_ALIAS(command, alias, desc, opt) @endcode
159165
*/
160166
#define MSH_CMD_EXPORT_ALIAS(...) \
161167
__MSH_GET_EXPORT_MACRO(__VA_ARGS__, _MSH_FUNCTION_EXPORT_CMD3_OPT, \
@@ -193,22 +199,25 @@ typedef struct msh_cmd_opt
193199
/* Command options declaration and definition macros */
194200

195201
/**
196-
* Declares a static array of command options for a specific command.
197-
* @param command The command associated with these options.
202+
* @brief Declares a static array of command options for a specific command.
203+
*
204+
* @param[in] command The command associated with these options.
198205
*/
199206
#define CMD_OPTIONS_STATEMENT(command) static struct msh_cmd_opt command##_msh_options[];
200207

201208
/**
202-
* Starts the definition of command options for a specific command.
203-
* @param command The command these options are associated with.
209+
* @brief Starts the definition of command options for a specific command.
210+
*
211+
* @param[in] command The command these options are associated with.
204212
*/
205213
#define CMD_OPTIONS_NODE_START(command) static struct msh_cmd_opt command##_msh_options[] = {
206214

207215
/**
208-
* Defines a single command option.
209-
* @param _id Unique identifier for the option.
210-
* @param _name The name of the option.
211-
* @param _des Description of the option.
216+
* @brief Defines a single command option.
217+
*
218+
* @param[in] _id Unique identifier for the option.
219+
* @param[in] _name The name of the option.
220+
* @param[in] _des Description of the option.
212221
*/
213222
#define CMD_OPTIONS_NODE(_id, _name, _des) {.id = _id, .name = #_name, .des = #_des},
214223

0 commit comments

Comments
 (0)