fix AT-MIO-16XE-50 calibration to take into account coarse postgain
authorFrank Mori Hess <fmhess@speakeasy.net>
Wed, 24 Aug 2005 22:35:04 +0000 (22:35 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Wed, 24 Aug 2005 22:35:04 +0000 (22:35 +0000)
offset that it seems to have (not sure though).

comedi_calibrate/ni.c

index 194b848a5eadef0e20c12194c22b09d719e24e06..16959d7df43991e2d21cea32dedbb3f719e745f7 100644 (file)
@@ -87,7 +87,7 @@ static struct board_struct boards[]={
        { "at-mio-16e-2", STATUS_DONE, cal_ni_at_mio_16e_2, ni_setup_observables, 0x1a9, 0x1aa },
        { "at-mio-16e-10", STATUS_DONE, cal_ni_at_mio_16e_10, ni_setup_observables, 0x1a7, 0x1a8 },
        { "at-mio-16xe-10", STATUS_UNKNOWN, NULL, ni_setup_observables, 0x1b7, 0x1b8 },
-       { "at-mio-16xe-50", STATUS_DONE, cal_ni_at_mio_16xe_50, ni_setup_observables, 0x1b5, 0x1b6 },
+       { "at-mio-16xe-50", STATUS_SOME, cal_ni_at_mio_16xe_50, ni_setup_observables, 0x1b5, 0x1b6 },
        { "at-mio-64e-3", STATUS_SOME, cal_ni_at_mio_64e_3, ni_setup_observables, 0x1a9, 0x1aa},
        { "DAQCard-ai-16e-4", STATUS_DONE, cal_ni_daqcard_ai_16e_4, ni_setup_observables, 0x1b5, 0x1b6 },
        { "DAQCard-ai-16xe-50", STATUS_DONE, cal_ni_daqcard_ai_16xe_50, ni_setup_observables, 0x1be, 0x1bf },
@@ -683,10 +683,15 @@ static int cal_ni_daqcard_ai_16xe_50(calibration_setup_t *setup)
 static int cal_ni_at_mio_16xe_50(calibration_setup_t *setup)
 {
        ni_caldac_layout_t layout;
-
+       if(comedi_get_version_code(setup->dev) < COMEDI_VERSION_CODE(0, 7, 71))
+       {
+               DPRINT(0, "WARNING: you need comedi driver version 0.7.71 or later\n"
+                "for this calibration to work properly\n" );
+       }
        init_ni_caldac_layout( &layout );
-       layout.adc_pregain_offset = 8;
-       layout.adc_postgain_offset = 2;
+       layout.adc_pregain_offset = 16;
+       layout.adc_postgain_offset = 8;
+       layout.adc_postgain_offset_fine = 2;
        layout.adc_gain = 0;
        layout.adc_gain_fine = 1;
        layout.dac_offset[ 0 ] = 6;