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

安装(编译)错误, ORANGEPI没定义, wiringPiSPISetupMode 形参不匹配 #1

Open
tinnal opened this issue Jul 25, 2020 · 1 comment

Comments

@tinnal
Copy link

tinnal commented Jul 25, 2020

刚才试了一下你的python版本。 发现安装都出错。

  1. 第一个错误应该是有如下信息的
    WiringPi/wiringPi/wiringPi.c:1631:5: error: 'version' undeclared (first use...
    检查了一下, 因为python setup.py的方法, 和代码目录wiringPi的build构建方法不一样, 直接在子目录build时会询问板子的类型, 然后设置环境PLATFORM变量, 然后在makefile里根据这个是去设定CONFIG_ORANGEPI这类宏的。 但在setup是, 并没有采用这个编译方案, 而是让python直接去编译源码,导致报错。我直接在setup里加入我买的版本的宏, 规避掉了:
    define_macros=[('CONFIG_ORANGEPI_PC2',None),('CONFIG_ORANGEPI',None)],
    你们到是要考虑增加点代码, 让别人在setup时选择。

  2. 第二个错误是在SPI的模式设定函数的定义上, 跟树莓派的不一致,导致出错。
    wiringpi_wrap.c: In function '_wrap_wiringPiSPISetupMode':
    wiringpi_wrap.c:5183:19: error: too few arguments to function 'wiringPiSPISetupMode'
    result = (int)wiringPiSPISetupMode(arg1,arg2,arg3);
    ^
    In file included from wiringpi_wrap.c:3031:0:
    WiringPi/wiringPi/wiringPiSPI.h:31:5: note: declared here
    int wiringPiSPISetupMode (int channel, int port, int speed, int mode) ;

我直接把代码改为和树莓派的一致,删掉了你的port参数, 编译通过了。 因为看了你C的样例程序, 你也不是直接调用wiringPiSPISetupMode的。 而是调用int wiringPiSPISetup (int channel, int speed) 。 这个函数也直接把port设置为0了。

This was referenced May 2, 2021
@alexgubanow
Copy link
Contributor

Hi @tinnal If this is still relevant, you welcome to try official_wiringOP branch. I have tested gpio part, but assume rest of library works too. Please close issue, once fix confirmed.

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