|
这是驱动read的源码
static int tq2440_irq_read(struct file *filp, char __user *buff, size_t count, loff_t *offp)
{
unsigned long err;
if (!ev_press)
{
if (filp->f_flags & O_NONBLOCK)
return -EAGAIN;
else
wait_event_interruptible(button_waitq, ev_press);
}
ev_press = 0;
err = copy_to_user(buff, (const void *)key_values, min(sizeof(key_values), count));
return err ? -EFAULT : min(sizeof(key_values), count);
}
当我用qt下面的定时器去读取中断
ret = read(buttons_fd, key_value_temp, sizeof(key_value_temp));
结果程序就停在这了,鼠标就动不了他好像就进入等待(wait)了
怎么办,求解 |
|