test.c
来自「2440 下的5*5按键驱动程序.请参看具体代码内容.」· C语言 代码 · 共 30 行
C
30 行
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/select.h>
#include <sys/time.h>
#include <errno.h>int main(void){ int i; int buttons_fd; buttons_fd = open("/dev/button",0); if (buttons_fd < 0) {
perror("open device button");
exit(1);
} else { printf("open succeed");} close(buttons_fd);// realse(buttons_fd); return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?