From 71bfe94dc9af0554e956c678aa73f8169c3422c6 Mon Sep 17 00:00:00 2001 From: hadaq Date: Mon, 29 Jun 2015 00:04:36 +0200 Subject: [PATCH] write thresholds did not use atomic-padiwa-access routine, what a mess.... now this is fixed. mt --- thresholds/write_thresholds.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/thresholds/write_thresholds.pl b/thresholds/write_thresholds.pl index fccdd89..79cf32f 100755 --- a/thresholds/write_thresholds.pl +++ b/thresholds/write_thresholds.pl @@ -3,7 +3,7 @@ use strict; use warnings; use Data::Dumper; -#use Dmon; +use Dmon; use Getopt::Long; use HADES::TrbNet; use POSIX qw(strftime); @@ -104,14 +104,15 @@ sub write_threshold { my $command= $fixed_bits | ($current_channel << 16) | ($thresh << $shift_bits); - #Dmon::PadiwaSendCmd($endpoint, $chain, $command); - send_command($endpoint, $chain, $command); + Dmon::PadiwaSendCmd($command, $endpoint, $chain); + #send_command($endpoint, $chain, $command); } sub send_command { (my $endpoint, my $chain, my $command) = @_; + my $ra_atomic = [$command,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1<<$chain,0x10001]; my $rh_res = trb_register_write_mem($endpoint, 0xd400, 0, $ra_atomic, scalar @{$ra_atomic}); send_command_error($endpoint) if (!defined $rh_res); -- 2.43.0