arduino多线程
2018-04-101.6万
AI 快速预览详细
本文讨论了在使用Arduino的ProtoThread库时遇到的编译错误,并提供了具体的解决方法。通过将函数声明从'extern'改为'static',可以解决'extern'和'static'声明冲突的问题。该方法适用于Arduino/Genuino Mega 2560开发板,帮助用户快速排除故障,节省调试时间。
|
我现在调用Arduino的ProtoThread库,可是编译的时候报错了: Arduino:1.6.6 (Windows 10), 开发板:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)" C:\Users\Administrator\Documents\Arduino\libraries\ProtoThreads\examples\ExampleSmall\ExampleSmall.pde: In function 'int protothread1(pt*)': ExampleSmall:24: error: 'int protothread1(pt*)' was declared 'extern' and later 'static' [-fpermissive] static int protothread1(struct pt *pt) ^ ExampleSmall:24: error: previous declaration of 'int protothread1(pt*)' [-fpermissive] static int protothread1(struct pt *pt) ^ C:\Users\Administrator\Documents\Arduino\libraries\ProtoThreads\examples\ExampleSmall\ExampleSmall.pde: In function 'int protothread2(pt*)': ExampleSmall:53: error: 'int protothread2(pt*)' was declared 'extern' and later 'static' [-fpermissive] static int protothread2(struct pt *pt) ^ ExampleSmall:25: error: previous declaration of 'int protothread2(pt*)' [-fpermissive] { ^ exit status 1 'int protothread1(pt*)' was declared 'extern' and later 'static' [-fpermissive] 报告将会包含更多的信息 "在编译时,输出详细信息" 在 文件>首选项 中启用 是怎么一回事? |



