From 1465834a26c87fd8c59a98afaae7a02407927f77 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Thu, 9 Jan 2014 15:23:13 +0000 Subject: [PATCH] demo/inpn: correct ranges in range loop The demo is supposed to take one reading for each channel for each range, but was using the range from the command line options instead. Thanks to Daniele Mazzi for spotting the bug! --- demo/inpn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/inpn.c b/demo/inpn.c index 82e6e2f..3ee00bb 100644 --- a/demo/inpn.c +++ b/demo/inpn.c @@ -64,8 +64,8 @@ int main(int argc, char *argv[]) maxdata = comedi_get_maxdata(device, options.subdevice, chan); for(range = 0; range < n_ranges; range++){ - comedi_data_read(device, options.subdevice, chan, options.range, options.aref, &data); - voltage = comedi_to_phys(data, comedi_get_range(device, options.subdevice, chan, options.range), maxdata); + comedi_data_read(device, options.subdevice, chan, range, options.aref, &data); + voltage = comedi_to_phys(data, comedi_get_range(device, options.subdevice, chan, range), maxdata); printf("%g ", voltage); } printf("\n");