From 8ce39041fa8652b676dbd6440b90f3d1de4a86ad Mon Sep 17 00:00:00 2001 From: David Schleef Date: Wed, 28 Aug 2002 23:56:37 +0000 Subject: [PATCH] Patch for cleaner analog output underrun handling from Ray Kelm --- comedi/drivers/ni_mio_common.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 622f57a6..559d4ef9 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -567,6 +567,7 @@ static void handle_a_interrupt(comedi_device *dev,unsigned short status, static void handle_b_interrupt(comedi_device *dev,unsigned short b_status) { + int ret; comedi_subdevice *s=dev->subdevices+1; //unsigned short ack=0; @@ -582,8 +583,16 @@ static void handle_b_interrupt(comedi_device *dev,unsigned short b_status) s->async->events |= COMEDI_CB_EOA; } - if(b_status&AO_FIFO_Request_St) - ni_ao_fifo_half_empty(dev,s); + if(b_status&AO_FIFO_Request_St){ + ret = ni_ao_fifo_half_empty(dev,s); + + if(!ret){ + rt_printk("ni_mio_common: AO buffer underrun\n"); + ni_set_bits(dev, Interrupt_B_Enable_Register, + AO_FIFO_Interrupt_Enable|AO_Error_Interrupt_Enable, 0); + s->async->events |= COMEDI_CB_OVERFLOW; + } + } b_status=win_in(AO_Status_1_Register); if(b_status&Interrupt_B_St){ -- 2.26.2