int cal_cb_pci_60xx( calibration_setup_t *setup )
{
+ saved_calibration_t saved_cals[1];
enum cal_knobs_60xx
{
DAC0_OFFSET = 0,
cal1( setup, OBS_5V_RANGE_10V_BIP_60XX, ADC_GAIN_FINE );
cal1_fine( setup, OBS_5V_RANGE_10V_BIP_60XX, ADC_GAIN_FINE );
- return 0;
+ saved_cals[ 0 ].subdevice = setup->ad_subdev;
+ saved_cals[ 0 ].caldacs_length = 0;
+ saved_cals[ 0 ].caldacs[ saved_cals[ 0 ].caldacs_length++ ] =
+ setup->caldacs[ ADC_OFFSET_FINE ];
+ saved_cals[ 0 ].caldacs[ saved_cals[ 0 ].caldacs_length++ ] =
+ setup->caldacs[ ADC_OFFSET_COARSE ];
+ saved_cals[ 0 ].caldacs[ saved_cals[ 0 ].caldacs_length++ ] =
+ setup->caldacs[ ADC_GAIN_COARSE ];
+ saved_cals[ 0 ].caldacs[ saved_cals[ 0 ].caldacs_length++ ] =
+ setup->caldacs[ ADC_GAIN_FINE ];
+ saved_cals[ 0 ].channels_length = 0;
+ saved_cals[ 0 ].ranges[ 0 ] = 0;
+ saved_cals[ 0 ].ranges_length = 1;
+ saved_cals[ 0 ].arefs_length = 0;
+
+ return write_calibration_file( setup->dev, saved_cals, 1 );
}
int cal_cb_pci_4020( calibration_setup_t *setup )
fprintf( file, "%i,", setting.arefs[ i ] );
fprintf( file, "],\n" );
fprintf( file, "%s", indent );
- fprintf( file, "\tcaldacs => [\n" );
+ fprintf( file, "\tcaldacs =>\n" );
+ fprintf( file, "%s", indent );
+ fprintf( file, "\t[\n" );
for( i = 0; i < setting.caldacs_length; i++ )
{
write_caldac( file, setting.caldacs[ i ] );
int i;
fprintf( file, "{\n" );
+ fprintf( file, "\tdriver_name => \"%s\",\n", comedi_get_driver_name( dev ) );
fprintf( file, "\tboard_name => \"%s\",\n", comedi_get_board_name( dev ) );
- fprintf( file, "\tcalibrations => [\n" );
+ fprintf( file, "\tcalibrations =>\n"
+ "\t[\n" );
for( i = 0; i < num_settings; i++ )
{
write_calibration_setting( file, settings[ i ] );
return -1;
}
- snprintf( file_path, sizeof( file_path ), "%s/comedi_0x%lx",
- save_dir, ( unsigned long ) file_stats.st_dev );
+ snprintf( file_path, sizeof( file_path ), "%s/%s_0x%lx",
+ save_dir, comedi_get_board_name( dev ),
+ ( unsigned long ) file_stats.st_ino );
file = fopen( file_path, "w" );
if( file == NULL )
{