From: Michael Traxler Date: Fri, 20 Dec 2019 18:16:21 +0000 (+0100) Subject: fixed to work with dirich, mt X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=426ef0ac8e7b1afb3526412e117b619ada7a89ab;p=daqtools.git fixed to work with dirich, mt --- diff --git a/thresholds/write_thresholds.pl b/thresholds/write_thresholds.pl index c2b567f..e090ab6 100755 --- a/thresholds/write_thresholds.pl +++ b/thresholds/write_thresholds.pl @@ -73,13 +73,13 @@ foreach my $cl (@f) { $chain = int($chain); $channel = int($channel); $thresh = hex($thresh); - + next if($thresh > 0xffff); $thresh -= $offset; #MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM # usleep(100000); - write_threshold("padiwa", $ep, $chain, $channel, $thresh); + write_threshold($mode, $ep, $chain, $channel, $thresh); $count++; } @@ -94,7 +94,8 @@ sub write_threshold { my $fixed_bits; my $shift_bits; - + my $channel_shift=16; + if($mode eq "padiwa") { $fixed_bits = 0x00800000; $shift_bits = 0; @@ -102,11 +103,27 @@ sub write_threshold { elsif ($mode eq "cbmrich") { $fixed_bits = 0x00300000; $shift_bits = 4; + } + elsif ($mode eq "dirich2") { + $fixed_bits = 0x8 << 20; + $shift_bits = 0; + $channel_shift = 24; + } + + + my $command= $fixed_bits | ( ($current_channel&0xf) << $channel_shift) | ($thresh << $shift_bits); + + if ($mode eq "dirich2") { + if ($current_channel<16) { + Dmon::PadiwaSendCmd($command,$endpoint, 0); + } else { + Dmon::PadiwaSendCmd($command,$endpoint, 1); + } + } elsif ($mode eq "padiwa") { + Dmon::PadiwaSendCmd($command,$endpoint, $chain); } - my $command= $fixed_bits | ($current_channel << 16) | ($thresh << $shift_bits); - - Dmon::PadiwaSendCmd($command, $endpoint, $chain); + #Dmon::PadiwaSendCmd($command, $endpoint, $chain); #send_command($endpoint, $chain, $command); }