从C/C++程序Debian激活驱动程序
Activate driver from C/C++ program Debian
尝试从BeagleBone Black Debian的C/C++程序中激活GPIO驱动程序。我没有激活驱动程序,而是收到了错误消息"sh:1:无法创建/sys/devices/bone_capemgr./slots:Directory不存在"。如果我直接在SSH终端中键入"echo-cape bone iio>/sys/devices/bone_cappemgr./spots",它可以正常工作。任何见解都将不胜感激。
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf( "Activate Analog GPIO drivern" );
system( "echo cape-bone-iio > /sys/devices/bone_capemgr.*/slots" );
printf( "donen" );
return 0;
}
这就成功了,仍然不确定echo为什么不起作用。
FILE *ain;
ain = fopen("/sys/devices/bone_capemgr.9/slots", "w");
fseek(ain,0,SEEK_SET);
fprintf(ain,"cape-bone-iio");
fflush(ain);
fclose(ain);
return 0;
相关文章:
- 将项目从 Debian 8 Xenomai 2.x 迁移到 Debain 9 Xenomai 3.x
- 如何在 Debian 10 上安装 CPP 手册页?
- 如何在日食中激活自动建议?
- QT5 信号不会激活插槽内的功能
- Debian Buster 中的库不匹配?
- 堆栈上的最大激活记录数
- 如何在 debian 下正确链接一个 opengl 程序?
- 使用 [#define & #ifdef] 跨文件激活代码块
- CNN的tanh()激活函数的实现
- Boost::log只在debian中崩溃
- C++(SFML?激活某些内容x秒钟,而不会冻结整个程序
- 激活上下文生成失败,依赖程序集,并行,事件 ID 33
- 当电子的窗口隐藏时如何激活另一个应用程序窗口
- 相机抖动未激活虚幻C++
- C++挂起线程,然后通过其他线程重新激活
- 激活填充和盐
- 无法在 64 位 Debian 上运行 32 位二进制文件
- curl_slist_free_all() 导致 GKE 与 Debian 8.7 上的段错误
- Visual Studio Code - 在调试之前激活环境
- 从C/C++程序Debian激活驱动程序