ledtest.c

来自「使用jupiter外部中断4的驱动和测试程序」· C语言 代码 · 共 34 行

C
34
字号
/*
#include <linux/ioctl.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>*/
#include <unistd.h>
#include <stdio.h>
//#include <stdlib.h>
//#include <string.h>
//#include <sys/types.h>
//#include <sys/stat.h>
#include <fcntl.h>

static int fd = -1;


int main(void)
{

fd=open("/dev/ledflash",O_NONBLOCK,0);
if(fd<0) 
{
	printf("Can't open\n");
	return -1;
	
}


   close(fd);
  return 0;
}


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?