want to use ino_t to identify comedi device file instead of dev_t, which
always contains major/minor number of hard drive
This commit is contained in:
parent
28c57d548a
commit
62d3635bc5
2 changed files with 26 additions and 5 deletions
|
@ -755,6 +755,7 @@ int cal_cb_pci_64xx( calibration_setup_t *setup )
|
|||
|
||||
int cal_cb_pci_60xx( calibration_setup_t *setup )
|
||||
{
|
||||
saved_calibration_t saved_cals[1];
|
||||
enum cal_knobs_60xx
|
||||
{
|
||||
DAC0_OFFSET = 0,
|
||||
|
@ -779,7 +780,22 @@ int cal_cb_pci_60xx( calibration_setup_t *setup )
|
|||
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 )
|
||||
|
|
|
@ -68,7 +68,9 @@ void write_calibration_setting( FILE *file, saved_calibration_t setting )
|
|||
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 ] );
|
||||
|
@ -88,8 +90,10 @@ int write_calibration_perl_hash( FILE *file, comedi_t *dev,
|
|||
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 ] );
|
||||
|
@ -124,8 +128,9 @@ int write_calibration_file( comedi_t *dev, saved_calibration_t settings[],
|
|||
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 )
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue