int retval;
lsampl_t clock_selection;
struct parsed_options options;
+ comedi_insn insn;
+ lsampl_t data[3];
init_parsed_options(&options);
options.freq = 0.;
{
printf("Clock period unspecified.\n");
}
- comedi_insn insn;
- lsampl_t data[3];
memset(&insn, 0, sizeof(comedi_insn));
insn.insn = INSN_CONFIG;
insn.subdev = options.subdevice;
int retval;
lsampl_t filter_selection;
struct parsed_options options;
+ comedi_insn insn;
+ lsampl_t data[2];
init_parsed_options(&options);
parse_options(&options, argc, argv);
}
filter_selection = options.value;
printf("Selecting filter %d on subdevice %d channel %d.\n", filter_selection, options.subdevice, options.channel);
- comedi_insn insn;
- lsampl_t data[2];
memset(&insn, 0, sizeof(comedi_insn));
insn.insn = INSN_CONFIG;
insn.subdev = options.subdevice;
int retval;
lsampl_t routing;
struct parsed_options options;
+ comedi_insn insn;
+ lsampl_t data[2];
init_parsed_options(&options);
options.freq = 0.;
period_ns = 0;
routing = options.value;
printf("Selecting routing %d for channel %d on subdevice %d.\n", routing, options.channel, options.subdevice);
- comedi_insn insn;
- lsampl_t data[2];
memset(&insn, 0, sizeof(comedi_insn));
insn.insn = INSN_CONFIG;
insn.subdev = options.subdevice;
int check_subdevice(comedi_t *device, int *subdevice, const char *device_filepath)
{
+ int subdevice_type;
int read_subdevice = comedi_get_read_subdevice(device);
if(read_subdevice < 0)
{
*subdevice, device_filepath, read_subdevice);
return -1;
}
- int subdevice_type = comedi_get_subdevice_type(device, *subdevice);
+ subdevice_type = comedi_get_subdevice_type(device, *subdevice);
if(subdevice_type < 0)
{
comedi_perror("comedi_get_subdevice_type()");
comedi_polynomial_t* polynomial)
{
comedi_range *range_ptr = comedi_get_range(dev, subdevice, channel, range);
+ lsampl_t maxdata;
+
if(range_ptr == NULL)
{
return -1;
}
- lsampl_t maxdata = comedi_get_maxdata(dev, subdevice, channel);
+ maxdata = comedi_get_maxdata(dev, subdevice, channel);
if(maxdata == 0)
{
return -1;
static comedi_polynomial_t* alloc_inverse_linear_polynomial(const comedi_polynomial_t *polynomial)
{
+ comedi_polynomial_t *inverse;
if(polynomial->order != 1) return NULL;
- comedi_polynomial_t *inverse = malloc(sizeof(comedi_polynomial_t));
+ inverse = malloc(sizeof(comedi_polynomial_t));
memset(inverse, 0, sizeof(comedi_polynomial_t));
inverse->order = 1;
inverse->expansion_origin = polynomial->coefficients[0];