From 46247c4783b3084325a18f9977c162c1b9f3b7ac Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 30 Nov 2000 01:29:10 +0000 Subject: [PATCH] random cleanup --- demo/tut2.c | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/demo/tut2.c b/demo/tut2.c index 25d1105..056f4b7 100644 --- a/demo/tut2.c +++ b/demo/tut2.c @@ -9,34 +9,28 @@ * source code. */ -#include /* for printf() */ +#include /* for printf() */ #include -int subdev = 0; /* change this to your input subdevice */ -int chan = 0; /* change this to your channel */ -int range = 0; /* more on this later */ -int aref = AREF_GROUND; /* more on this later */ +int subdev = 0; /* change this to your input subdevice */ +int chan = 0; /* change this to your channel */ +int range = 0; /* more on this later */ +int aref = AREF_GROUND; /* more on this later */ -int main(int argc,char *argv[]) +int main(int argc, char *argv[]) { - comedi_t *cf; - int chan=0; - int data; - int maxdata; - double volts; + comedi_t *cf; + lsampl_t data; + int maxdata; + double volts; comedi_range *cr; - cf=comedi_open("/dev/comedi0"); + cf = comedi_open("/dev/comedi0"); + maxdata = comedi_get_maxdata(cf, subdev, chan); + cr = comedi_get_range(cf, subdev, chan, range); + comedi_data_read(cf, subdev, chan, range, aref, &data); + volts = comedi_to_phys(data, cr, maxdata); + printf("%d %g\n", data, volts); - maxdata=comedi_get_maxdata(cf,subdev,chan); - - cr=comedi_get_range(cf,subdev,chan,range); - - comedi_data_read(cf,subdev,chan,range,aref,&data); - - volts=comedi_to_phys(data,cr,maxdata); - - printf("%d %g\n",data,volts); - - return 0; + return 0; } -- 2.26.2