在源码中,使用MSH_CMD_EXPORT导出函数到对应命令。 externvoidrt_show_version(void);longversion(void){ rt_show_version();return0; } MSH_CMD_EXPORT(version, show RT-Thread version information); MSH_CMD_EXPORT是一个宏: #defineMSH_CMD_EXPORT(command, desc) \ MSH_FUNCTION_EXPORT_CMD(command, co...
MSH_CMD_EXPORT是宏定义,完整内容在finsh_api,h中 define MSH_CMD_EXPORT(command, desc) \ FINSH_FUNCTION_EXPORT_CMD(command, __cmd_##command, desc)而FINSH_FUNCTION_EXPORT_CMD又是另外一个宏定义,也在finsh_api,h中 define FINSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \ const ...