]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
adc.pl: Fix some bug adc_init when reduced number of ADCs present
authorAndreas Neiser <neiser@kph.uni-mainz.de>
Wed, 17 Jun 2015 13:57:07 +0000 (15:57 +0200)
committerAndreas Neiser <neiser@kph.uni-mainz.de>
Wed, 17 Jun 2015 13:57:16 +0000 (15:57 +0200)
tools/adc.pl

index ed0b486ad102de103af603077a0d013955902a2d..501b3853434b83cfd55e25f04ef05514dad32573 100755 (executable)
@@ -146,6 +146,7 @@ sub adc_init {
     &set_optimal_phases;
     print ">>> Check ADCs again...\n";
     my @good = map {$_->[0]} &adc_testall; # no phases given, so single element arrays expected
+    @good = grep { defined $_ } @good; # not all adcs might have been tested
     #print Dumper(\@good);
     # check if all ADCs are good
     if (@good == grep { $_ } @good) {
@@ -496,6 +497,7 @@ sub set_optimal_phases {
     @adcs = ($adc);             # used by adc_phase
     adc_phase($opt_phase);
     #printf("Set ADC %02d to optimal phase of %03d degrees\n", $adc, $opt_phase*60);
+    @adcs = @old_adcs;
   }
 
   @adcs = @old_adcs;