From: Frank Mori Hess Date: Tue, 11 Mar 2003 22:23:59 +0000 (+0000) Subject: make underrun detection play nice with stop_src TRIG_COUNT X-Git-Tag: r0_7_67x~66 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2f2720bcc3f8ee6e81ad0500def26ad93251c149;p=comedi.git make underrun detection play nice with stop_src TRIG_COUNT --- 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);