From 486c46d59f5ae3647be1a5adb1d6a4b2b407814c Mon Sep 17 00:00:00 2001 From: hadeshyp Date: Wed, 14 Nov 2012 22:30:49 +0000 Subject: [PATCH] get.pl --- cts/htdocs/thresh/get.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cts/htdocs/thresh/get.pl b/cts/htdocs/thresh/get.pl index 65685f8..7750804 100755 --- a/cts/htdocs/thresh/get.pl +++ b/cts/htdocs/thresh/get.pl @@ -34,14 +34,16 @@ if($amount != 1) { my $i = 0; my @hits; do { - $hits[$i] = trb_register_read_mem($board,$addr+$i*$chunk,0,$amount/$split); + $hits[$i] = trb_register_read_mem($board,$addr+$i*$chunk,0,$chunk); # print ($board." ".($addr+$i*$chunk)." ".($amount/$split)."\n"); } while(++$i < $split); foreach my $b (sort keys %{$hits[0]}) { printf ("%04x",$b); for(my $i = 0; $i < scalar @hits; $i++) { for(my $c =0; $c < $chunk; $c++) { - printf(" %d",$hits[$i]->{$b}->[$c]); + if($i*$chunk + $c < $amount) { + printf(" %d",$hits[$i]->{$b}->[$c]); + } } } print "&"; -- 2.43.0