unsigned int *chanlist; /* driver-owned chanlist (not used) */
-#ifdef CONFIG_COMEDI_TRIG
- comedi_trig cur_trig; /* current trig structure */
- int (*trig[5])(comedi_device *,comedi_subdevice *,comedi_trig *);
-#endif
-
int (*insn_read)(comedi_device *,comedi_subdevice *,comedi_insn *,lsampl_t *);
int (*insn_write)(comedi_device *,comedi_subdevice *,comedi_insn *,lsampl_t *);
int (*insn_bits)(comedi_device *,comedi_subdevice *,comedi_insn *,lsampl_t *);
int (*do_cmdtest)(comedi_device *,comedi_subdevice *,comedi_cmd *);
int (*poll)(comedi_device *,comedi_subdevice *);
int (*cancel)(comedi_device *,comedi_subdevice *);
- int (*do_lock)(comedi_device *,comedi_subdevice *);
- int (*do_unlock)(comedi_device *,comedi_subdevice *);
int (*buf_change)(comedi_device *,comedi_subdevice *s);
void check_null(void);
void check_mask(void);
void check_mask_2(void);
+void check_timed(void);
comedi_cmd cmd_mask;
check_null();
check_mask();
check_mask_2();
+ check_timed();
return 0;
}
+void dump_cmd(comedi_cmd *cmd)
+{
+ printf("start_src: %08x\n",cmd->start_src );
+ printf("scan_begin_src: %08x\n",cmd->scan_begin_src );
+ printf("convert_src: %08x\n",cmd->convert_src );
+ printf("scan_end_src: %08x\n",cmd->scan_end_src );
+ printf("stop_src: %08x\n",cmd->stop_src );
+}
+
void check_null(void)
{
comedi_cmd cmd;
ret = cmd_test(dev,s,&cmd);
if(ret!=1)printf("E: mask returned %d\n",ret);
- printf("start_src: %08x\n",cmd.start_src );
- printf("scan_begin_src: %08x\n",cmd.scan_begin_src );
- printf("convert_src: %08x\n",cmd.convert_src );
- printf("scan_end_src: %08x\n",cmd.scan_end_src );
- printf("stop_src: %08x\n",cmd.stop_src );
+ dump_cmd(&cmd);
cmd_mask=cmd;
}
if(ret<2)printf("E: mask_2 returned %d\n",ret);
}
+void check_timed(void)
+{
+ int ret;
+ int i;
+ unsigned int freq = 10000;
+ unsigned int n_scan = 10000;
+ unsigned int n_chan = 4;
+ unsigned int chanlist[4];
+ comedi_cmd c = {
+ start_src: TRIG_NOW,
+ start_arg: 0,
+ scan_begin_src: TRIG_TIMER,
+ scan_begin_arg: 1e9/freq,
+ convert_src: TRIG_TIMER,
+ convert_arg: 1,
+ scan_end_src: TRIG_COUNT,
+ scan_end_arg: n_chan,
+ stop_src: TRIG_COUNT,
+ stop_arg: n_scan,
+ chanlist: chanlist,
+ chanlist_len: n_chan,
+ };
+ comedi_cmd *cmd = &c;
+
+ for(i=0;i<n_chan;i++){
+ chanlist[i]=CR_PACK(i,0,AREF_GROUND);
+ }
+
+ ret = cmd_test(dev,s,cmd);
+ if(ret<3)printf("W: timed returned %d\n",ret);
+ printf("timed returned %d\n",ret);
+
+ dump_cmd(cmd);
+
+}
/* begin autogenerated */