From: Frank Mori Hess Date: Wed, 16 Mar 2005 19:05:34 +0000 (+0000) Subject: use SDF_RUNNING flag to test for completion of ao command X-Git-Tag: v0_8_0~116 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=933be9aae494781bc797f8d7575dfad0435a0698;p=comedilib.git use SDF_RUNNING flag to test for completion of ao command --- diff --git a/testing/cmd_1.c b/testing/cmd_1.c index e9d337a..f43ee27 100644 --- a/testing/cmd_1.c +++ b/testing/cmd_1.c @@ -251,12 +251,16 @@ int test_cmd_write_fast_1chan(void) } // make sure all samples have been written out while(1) - { - ret = comedi_get_buffer_contents(device, subdevice); - if(ret < 0) + { + int flags = comedi_get_subdevice_flags(device,subdevice); + if(flags < 0) { - printf("E: comedi_get_buffer_contents() returned %i\n", ret); - }else if(ret == 0) break; + printf("E: comedi_get_subdevice_flags returned %i\n", flags); + break; + } + if((flags & SDF_RUNNING) == 0){ + break; + } usleep(10000); } // cancel needed in the case of stop_src==TRIG_NONE