From 2f2720bcc3f8ee6e81ad0500def26ad93251c149 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Tue, 11 Mar 2003 22:23:59 +0000 Subject: [PATCH] make underrun detection play nice with stop_src TRIG_COUNT --- comedi/drivers/ni_mio_common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 167c7042..a61bb6ed 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -367,6 +367,9 @@ static void mite_handle_b_linkc(struct mite_struct *mite, comedi_device *dev) new_write_count = async->buf_write_count; nbytes = mite_bytes_read(mite, AO_DMA_CHAN); + if( async->cmd.stop_src == TRIG_COUNT && + (int) (nbytes - async->cmd.stop_arg * sizeof( sampl_t ) ) > 0 ) + nbytes = async->cmd.stop_arg * sizeof( sampl_t ); if( (int)(nbytes - devpriv->last_buf_write_count) > 0 ){ rt_printk("ni_mio_common: DMA underrun\n"); ni_ao_reset(dev,s); -- 2.26.2