unsigned int ui_AiNbrofChannels; /* how many channels is measured */
unsigned int ui_AiChannelList[32]; /* actual chanlist */
unsigned int ui_AiReadData[32];
- unsigned int ui_AiNbrofScans; /* number of scans to do */
unsigned short us_UseDma; /* To use Dma or not */
unsigned char b_DmaDoubleBuffer; /* we can use double buffering */
unsigned int ui_DmaActualBuffer; /* which buffer is used now */
devpriv->ui_DmaActualBuffer = 0;
/* value for timer2 minus -2 has to be done .....dunno y?? */
- ui_TimerValue2 = devpriv->ui_AiNbrofScans - 2;
+ ui_TimerValue2 = cmd->stop_arg - 2;
ui_ConvertTiming = cmd->convert_arg;
if (mode == 2)
* Must we fill full first buffer? And must we fill
* full second buffer when first is once filled?
*/
- if (dmalen0 > (devpriv->ui_AiNbrofScans * scan_bytes)) {
- dmalen0 = devpriv->ui_AiNbrofScans * scan_bytes;
- } else if (dmalen1 > (devpriv->ui_AiNbrofScans * scan_bytes - dmalen0))
- dmalen1 = devpriv->ui_AiNbrofScans *
- scan_bytes - dmalen0;
+ if (dmalen0 > (cmd->stop_arg * scan_bytes)) {
+ dmalen0 = cmd->stop_arg * scan_bytes;
+ } else if (dmalen1 > (cmd->stop_arg * scan_bytes -
+ dmalen0))
+ dmalen1 = cmd->stop_arg * scan_bytes -
+ dmalen0;
}
if (cmd->flags & TRIG_WAKE_EOS) {
/* loading private structure with cmd structure inputs */
devpriv->ui_AiNbrofChannels = cmd->chanlist_len;
- if (cmd->stop_src == TRIG_COUNT)
- devpriv->ui_AiNbrofScans = cmd->stop_arg;
- else
- devpriv->ui_AiNbrofScans = 0;
-
- if ((devpriv->ui_AiNbrofScans == 0) || (devpriv->ui_AiNbrofScans == -1))
+ if (cmd->stop_src == TRIG_NONE)
devpriv->b_AiContinuous = 1; /* user want neverending analog acquisition */
/* stopped using cancel */
}
}
if (!devpriv->b_AiContinuous)
- if (devpriv->ui_AiActualScan >= devpriv->ui_AiNbrofScans) {
+ if (devpriv->ui_AiActualScan >= cmd->stop_arg) {
/* all data sampled */
apci3120_cancel(dev, s);
devpriv->b_AiCyclicAcquisition = APCI3120_DISABLE;