From: Frank Mori Hess Date: Sun, 15 Jun 2008 15:45:47 +0000 (+0000) Subject: Fixed number of output samples for m-series boards when using analog X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bec0f1bf15212597d453f96e7211077fc4381872;p=comedi.git Fixed number of output samples for m-series boards when using analog output command with stop_src==TRIG_COUNT --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 3ef409ff..4832367e 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -3119,10 +3119,18 @@ static int ni_ao_cmd(comedi_device * dev, comedi_subdevice * s) devpriv->stc_writew(dev, devpriv->ao_mode2, AO_Mode_2_Register); switch (cmd->stop_src) { case TRIG_COUNT: - devpriv->stc_writel(dev, cmd->stop_arg, AO_UC_Load_A_Register); - devpriv->stc_writew(dev, AO_UC_Load, AO_Command_1_Register); - devpriv->stc_writel(dev, cmd->stop_arg - 1, - AO_UC_Load_A_Register); + if(boardtype.reg_type & ni_reg_m_series_mask) + { + // this is how the NI example code does it for m-series boards, verified correct with 6259 + devpriv->stc_writel(dev, cmd->stop_arg - 1, AO_UC_Load_A_Register); + devpriv->stc_writew(dev, AO_UC_Load, AO_Command_1_Register); + }else + { + devpriv->stc_writel(dev, cmd->stop_arg, AO_UC_Load_A_Register); + devpriv->stc_writew(dev, AO_UC_Load, AO_Command_1_Register); + devpriv->stc_writel(dev, cmd->stop_arg - 1, + AO_UC_Load_A_Register); + } break; case TRIG_NONE: devpriv->stc_writel(dev, 0xffffff, AO_UC_Load_A_Register);