setup.da_subdev = da_subdev;
setup.eeprom_subdev = eeprom_subdev;
setup.caldac_subdev = caldac_subdev;
+ setup.settling_time_ns = 99999;
retval = this_board->init_setup( &setup, devicename );
if( retval < 0 ){
new_sv_init(&sv, setup->dev,
setup->observables[obs].observe_insn.subdev,
setup->observables[obs].observe_insn.chanspec);
- sv.order=7;
- // read internal calibration source and turn on dithering
- //sv.cr_flags = CR_ALT_FILTER | CR_ALT_SOURCE;
- //sv.cr_flags = CR_ALT_FILTER;
+ sv.settling_time_ns = setup->settling_time_ns;
n = new_sv_measure(setup->dev, &sv);
sci_sprint_alt(s,sv.average,sv.error);
x2 = setup->caldacs[dac].maxdata;
new_sv_init(&sv, setup->dev,0,chanspec);
+ sv.settling_time_ns = setup->settling_time_ns;
setup->caldacs[dac].current = x1;
update_caldac( setup, dac );
usleep(100000);
y1 = sv.average;
new_sv_init(&sv, setup->dev,0,chanspec);
+ sv.settling_time_ns = setup->settling_time_ns;
setup->caldacs[dac].current = x2;
update_caldac( setup, dac );
usleep(100000);
DPRINT(3,"trying %d\n",x);
new_sv_init(&sv, setup->dev,0,chanspec);
+ sv.settling_time_ns = setup->settling_time_ns;
setup->caldacs[dac].current = x;
update_caldac( setup, dac );
usleep(100000);
usleep(100000);
preobserve( setup, obs1);
new_sv_init(&sv1, setup->dev,0,chanspec1);
+ sv1.settling_time_ns = setup->settling_time_ns;
new_sv_measure( setup->dev, &sv1);
y1 = sv1.average;
preobserve( setup, obs2);
new_sv_init(&sv2, setup->dev,0,chanspec2);
+ sv2.settling_time_ns = setup->settling_time_ns;
new_sv_measure( setup->dev, &sv2);
y1 -= sv2.average;
usleep(100000);
preobserve( setup, obs1);
new_sv_init(&sv1, setup->dev,0,chanspec1);
+ sv1.settling_time_ns = setup->settling_time_ns;
new_sv_measure( setup->dev, &sv1);
y2 = sv1.average;
preobserve( setup, obs2);
new_sv_init(&sv2, setup->dev,0,chanspec2);
+ sv2.settling_time_ns = setup->settling_time_ns;
new_sv_measure( setup->dev, &sv2);
y2 -= sv2.average;
preobserve( setup, obs1);
new_sv_init(&sv1, setup->dev,0,chanspec1);
+ sv1.settling_time_ns = setup->settling_time_ns;
new_sv_measure( setup->dev, &sv1);
y = sv1.average;
preobserve( setup, obs2);
new_sv_init(&sv2, setup->dev,0,chanspec2);
+ sv2.settling_time_ns = setup->settling_time_ns;
new_sv_measure( setup->dev, &sv2);
y -= sv2.average;
orig = setup->caldacs[cdac].current;
new_sv_init(&sv, setup->dev,0,ad_chanspec);
- // read internal calibration source and turn on dithering
- //sv.cr_flags = CR_ALT_FILTER | CR_ALT_SOURCE;
- //sv.cr_flags = CR_ALT_FILTER;
+ sv.settling_time_ns = setup->settling_time_ns;
setup->caldacs[cdac].current=0;
update_caldac( setup, cdac );
orig = setup->caldacs[cdac].current;
new_sv_init(&sv, setup->dev,0,ad_chanspec);
- // read internal calibration source and turn on dithering
- //sv.cr_flags = CR_ALT_FILTER | CR_ALT_SOURCE;
- //sv.cr_flags = CR_ALT_FILTER;
+ sv.settling_time_ns = setup->settling_time_ns;
setup->caldacs[cdac].current=0;
update_caldac( setup, cdac );
char str[20];
new_sv_init(&sv, setup->dev, 0,CR_PACK(adc,range,AREF_OTHER));
- sv.order=7;
- //sv.cr_flags = CR_ALT_FILTER;
+ sv.settling_time_ns = setup->settling_time_ns;
n=new_sv_measure( setup->dev, &sv);
new_sv_t sv;
new_sv_init(&sv, setup->dev,0,CR_PACK(adc,range,AREF_OTHER));
- sv.order=7;
- // turn on dithering
- //sv.cr_flags = CR_ALT_FILTER;
+ sv.settling_time_ns = setup->settling_time_ns;
n=new_sv_measure( setup->dev, &sv);
printf("hint barf\n");
goto out;
}
- comedi_nanodelay(dev, 1000*99);
- //usleep( 1000 );
+ comedi_nanodelay(dev, sv->settling_time_ns);
ret = comedi_data_read_n(dev, sv->subd, sv->chanspec, 0, 0, data, n);
if(ret<0){