/* This kind of situation is recoverable, but it is easier to just pretend we had a FIFO underrun, since there is a good chance it will happen anyway. This is  */
static int ni_ao_fifo_half_empty(struct comedi_device *dev, struct comedi_subdevice *s)
/* This kind of situation is recoverable, but it is easier to just pretend we had a FIFO underrun, since there is a good chance it will happen anyway. This is  */
static int ni_ao_fifo_half_empty(struct comedi_device *dev, struct comedi_subdevice *s)
{
	int n;
	n = comedi_buf_read_n_available(s->async);
	if (n == 0) {
		s->async->events |= COMEDI_CB_OVERFLOW;
		return 0;
	}
	n /= sizeof(short);
	if (n > boardtype.ao_fifo_depth / 2)
		n = boardtype.ao_fifo_depth / 2;
	ni_ao_fifo_load(dev, s, n);
	s->async->events |= COMEDI_CB_BLOCK;
	return 1;
}