]> jspc29.x-matter.uni-frankfurt.de Git - hades_mdc_settings.git/commitdiff
threshold setting as decimal number
authorJan Michel <michel@physik.uni-frankfurt.de>
Fri, 16 Dec 2022 19:28:59 +0000 (20:28 +0100)
committerJan Michel <michel@physik.uni-frankfurt.de>
Fri, 16 Dec 2022 19:28:59 +0000 (20:28 +0100)
scripts/pasttrec_set_threshold.pl

index 70e92b79a4a34a911455a6e5135853a9242f691f..7add8d2478daa0415e66836da43e0e67fd6cb356 100755 (executable)
@@ -6,10 +6,13 @@ use Time::HiRes;
 my $threshold = $ARGV[0];
  
 trb_init_ports() or die trb_strerror();
-trb_init_ports() or die trb_strerror();
+
+if($threshold < 0 || $threshold > 127) {
+  die "not in valid range 0..127\n";
+  }
   
 foreach my $pt (0..3) { 
-        trb_register_write(0xfe91,0xa200+($pt << 4)+3,0x50300+hex($threshold));
-      }
+  trb_register_write(0xfe91,0xa200+($pt << 4)+3,0x50300+$threshold);
+  }
   
 printf(" Threshold %i set to all available PASTTRECs. \n", $threshold);