用这个板子的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盘复制到板子/目录 用串口命令行操作运行