DM6446之GPIO中断
应用程序如下所示。#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 fd,key_value,ret; fd=open("/dev/key",0); if(fd<0){ perror("open /dev/key error!\n"); exit(1); } printf("open /dev/key sucessfully!\n"); while(1){ ret=read(fd,&key_value,sizeof(key_value)); printf("In main(),key_value is '%d'\n\n",key_value); } close(fd); return 0;}