Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

看了README.md 不是很理解,请问如何添加命令实现功能? #16

Open
panguoxian opened this issue Oct 12, 2019 · 2 comments

Comments

@panguoxian
Copy link

panguoxian commented Oct 12, 2019

比如我要实现串口发送一个数据 ,
实现功能函数已写好,命令使用 "send".
void usart_send(void){
}

我应该如何操作?

我使用main函数形式,但是编译报错:section attribute cannot be specified for local variables

func(int argc, char *agrv[])
{
printf("%dparameter(s)\r\n", argc);
for (char i = 1; i < argc; i++)
{
printf("%s\r\n", argv[i]);
}
}
SHELL_EXPORT_CMD(func, func, test)

@NevermindZZT
Copy link
Owner

命令导出的写法是对的,请问你是用的gcc吗
gcc环境之前是在esp8266上做的验证,没有在STM32上试过,如果编译有问题,可以先尝试使用命令表的方式定义命令
之后会再在gcc上进行验证

@panguoxian
Copy link
Author

已解决,非常感谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants