static int ni_gpct_insn_config(comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,lsampl_t *data);
-#define AIMODE_NONE 0
-#define AIMODE_HALF_FULL 1
-#define AIMODE_SCAN 2
-#define AIMODE_SAMPLE 3
+enum aimodes
+{
+ AIMODE_NONE = 0,
+ AIMODE_HALF_FULL = 1,
+ AIMODE_SCAN = 2,
+ AIMODE_SAMPLE = 3,
+};
static const int num_adc_stages_611x = 3;
if(status&AI_FIFO_Half_Full_St){
ni_handle_fifo_half_full(dev);
}
- /* XXX These don't work if DMA is running */
+#endif // !PCIDMA
+
if(devpriv->aimode==AIMODE_SCAN && status&AI_STOP_St){
+#ifdef PCIDMA
+ mite_handle_a_linkc(devpriv->mite, dev);
+#else
ni_handle_fifo_dregs(dev);
-
+#endif
s->async->events |= COMEDI_CB_EOS;
/* we need to ack the START, also */
//s->async->events |= COMEDI_CB_SAMPLE;
}
-#endif // !PCIDMA
if(ack) win_out(ack,Interrupt_A_Ack_Register);
cmd->stop_arg=0x00ffffff;
err++;
}
+ if(cmd->stop_arg < 2){
+ cmd->stop_arg = 2;
+ err++;
+ }
}else{
/* TRIG_NONE */
if(cmd->stop_arg!=0){
switch(devpriv->aimode){
case AIMODE_HALF_FULL:
- /*generate FIFO interrupts on half-full */
+ /*generate FIFO interrupts and DMA requests on half-full */
#ifdef PCIDMA
- win_out(AI_FIFO_Mode_HF_to_E|0x0000,AI_Mode_3_Register);
+ win_out(AI_FIFO_Mode_HF_to_E, AI_Mode_3_Register);
#else
- win_out(AI_FIFO_Mode_HF|0x0000,AI_Mode_3_Register);
+ win_out(AI_FIFO_Mode_HF, AI_Mode_3_Register);
#endif
break;
case AIMODE_SAMPLE:
/*generate FIFO interrupts on non-empty */
- win_out(AI_FIFO_Mode_NE|0x0000,AI_Mode_3_Register);
+ win_out(AI_FIFO_Mode_NE, AI_Mode_3_Register);
break;
case AIMODE_SCAN:
- /*generate FIFO interrupts on half-full */
- win_out(AI_FIFO_Mode_HF|0x0000,AI_Mode_3_Register);
+#ifdef PCIDMA
+ win_out(AI_FIFO_Mode_NE, AI_Mode_3_Register);
+#else
+ win_out(AI_FIFO_Mode_HF, AI_Mode_3_Register);
+#endif
bits|=AI_STOP_Interrupt_Enable;
break;
default:
cmd->stop_arg=0x00ffffff;
err++;
}
+ if(cmd->stop_arg < 2){
+ cmd->stop_arg = 2;
+ err++;
+ }
}else{
/* TRIG_NONE */
if(cmd->stop_arg!=0){