-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Description
-
看到RTT最新版本支持MSH的自动补全功能,想要测试使用;却无从下手
-
查看合并的pr:【msh】新增msh自动补全子选项特性 #8086
才从cmd.c文件中搞懂使用方式
rt-thread/components/drivers/misc/rt_drv_pwm.c
Lines 441 to 450 in 56fd698
CMD_OPTIONS_NODE_START(pwm_list) CMD_OPTIONS_NODE(PWM_LIST_PROBE, probe, probe pwm by name) CMD_OPTIONS_NODE(PWM_LIST_ENABLE, enable, enable pwm channel) CMD_OPTIONS_NODE(PWM_LIST_DISABLE, disable, disable pwm channel) CMD_OPTIONS_NODE(PWM_LIST_GET, get, get pwm channel info) CMD_OPTIONS_NODE(PWM_LIST_SET, set, set pwm channel info) CMD_OPTIONS_NODE(PWM_LIST_PHASE, phase, set pwm phase) CMD_OPTIONS_NODE(PWM_LIST_DEAD_TIME, dead_time, set pwm dead time) CMD_OPTIONS_NODE_END MSH_CMD_EXPORT_ALIAS(pwm_list, pwm, control pwm device, optenable); -
是否应该在使用时附上使用方式
rt-thread/components/finsh/finsh.h
Lines 123 to 135 in 56fd698
/** * @ingroup msh * * This macro exports a command to module shell. * * @param command is the name of the command. * @param desc is the description of the command, which will show in help list. * @param opt This is an option, enter any content to enable option completion */ /* MSH_CMD_EXPORT(command, desc) or MSH_CMD_EXPORT(command, desc, opt) */ #define MSH_CMD_EXPORT(...) \ __MSH_GET_MACRO(__VA_ARGS__, _MSH_FUNCTION_CMD2_OPT, \ _MSH_FUNCTION_CMD2)(__VA_ARGS__)
Metadata
Metadata
Assignees
Labels
No labels