module_exit(third_drv_exit);
MODULE_LICENSE("GPL");
测试程序 irq_botton_test.c
#include
#include
#include
#include
/* irq_botton test
*
*/
int main(int argc, char **argv)
{
int fd;
unsigned char key_val;
fd = open("/dev/bottons", O_RDWR);
if (fd < 0)
{
printf("can't open!\n");
}
while (1)
{
read(fd, &key_val, 1);
printf("key_val = 0x%x\n", key_val);
}
return 0;
}
测试

该测试程序 只占了0.0%的CPU 相比查询方式节省下了极大的系统资源
