From 933be9aae494781bc797f8d7575dfad0435a0698 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Wed, 16 Mar 2005 19:05:34 +0000 Subject: [PATCH] use SDF_RUNNING flag to test for completion of ao command --- testing/cmd_1.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 -- 2.26.2