if(defined $ARGV[0] and $ARGV[0] eq "powercycle") {
die "No Channel given to powercycle" unless defined $ARGV[1];
my $channel = $ARGV[1] eq "1" ? 1 : 0;
- do_power_cycle($channel);
+ my $no_powerup = defined $ARGV[2];
+ do_power_cycle($channel,$no_powerup);
}
# serial connection is closed in END {} block
}
sub do_power_cycle {
my $ch = shift;
+ my $skip = shift;
print "Powercycling Output $ch...\n";
# enable remote control
send_and_read("F100361010",$ch);
$timeout--;
}
- if($timeout>0) {
+ if(!$skip && $timeout>0) {
print "Waiting a bit more...\n";
sleep(10);
print_current_values($ch);
send_and_read("F100360101",$ch);
sleep(1);
}
- else {
+ elsif(!$skip) {
print "Could not reach Voltage < 1 V before timeout.\n";
}