S5PV210友善smart tiny 210板子led测试程序 test程序不能再板子运行

用这个板子的test程序

#include<stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>


int main(int argc, char **argv)
{
int on;
int led_no;
int fd;


if (argc != 3 || sscanf(argv[1], "%d", &led_no) !=1 || sscanf(argv[2],"%d", &on) != 1 ||
on < 0 || on > 1 || led_no< 0 || led_no > 3) {
fprintf(stderr, "Usage: leds led_no 0|1\n");
exit(1);
}


fd = open("/dev/leds0", 0);
if (fd < 0) {
fd = open("/dev/leds", 0);
}
if (fd < 0) {
perror("open device leds");
exit(1);
}


ioctl(fd, on, led_no);


close(fd);
return 0;
}


 arm-linux-gcc -o test test.c编译后在板子不能./test运行


要用-static静态编译  arm-linux-gcc -o test test.c-static编译后就可以运行了

板子是Android系统 我用U盘复制到板子/目录 用串口命令行操作运行

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值