$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++;
}
my $fixed_bits;
my $shift_bits;
-
+ my $channel_shift=16;
+
if($mode eq "padiwa") {
$fixed_bits = 0x00800000;
$shift_bits = 0;
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);
}