13 #include "comedi_test.h"
15 static int get_chunks_per_length(int length);
19 int test_cmd_fifo_depth_check(void)
22 unsigned int flags = comedi_get_subdevice_flags(device,subdevice);
24 if(!(flags&SDF_CMD) || (comedi_get_read_subdevice(device)!=subdevice)){
25 printf("not applicable\n");
29 for(len=64;len<65536;len<<=1){
30 printf("%d, %d\n",len,get_chunks_per_length(len));
36 static int get_chunks_per_length(int length)
40 unsigned int chanlist[1];
46 if(comedi_get_cmd_generic_timed(device, subdevice, &cmd, 1, 1)<0){
47 printf(" not supported\n");
51 if(realtime)cmd.flags |= TRIG_RT;
53 cmd.chanlist = chanlist;
55 cmd.stop_arg = length;
57 chanlist[0] = CR_PACK(0,0,0);
59 comedi_command(device,&cmd);
63 ret = read(comedi_fileno(device),buf,BUFSZ);