From b3dacb98a72eff853457ab90af32ee26afb5e213 Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Wed, 11 Jan 2023 10:11:22 +0100 Subject: [PATCH] extend timeout for long chains --- atmega32u4/dcdc_mdc/mdc_powerboard.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/atmega32u4/dcdc_mdc/mdc_powerboard.pl b/atmega32u4/dcdc_mdc/mdc_powerboard.pl index 072aca8..36f3731 100755 --- a/atmega32u4/dcdc_mdc/mdc_powerboard.pl +++ b/atmega32u4/dcdc_mdc/mdc_powerboard.pl @@ -86,13 +86,13 @@ sub Cmd { $c .= "\n"; print $port "$c"; my $x = ""; - for my $i (0..10) { + for my $i (0..20) { $x .= <$port>//''; if($x && (substr($x,-1) eq "\n" || substr($x,-1) eq "\r" || length($x)>=10) ) { chomp $x; return $x; } - usleep(1000); + usleep(10000); } return; } @@ -101,7 +101,7 @@ sub PrintAnswerNice { my ($s) = @_; $s //= ""; my $FSR = 0.002; #Full Sclae Range is set to +-4.096V; LSB Size is 2mV - if (substr($s,0,1) ne 'A') {die 'not a correct Answer from DCDC board'} + if (substr($s,0,1) ne 'A') {die "not a correct Answer from DCDC board: $s\n"} my $command = hex(substr($s,5,1)); my $ch = hex(substr($s,4,1)); my $outp = hex(substr($s,3,1)); -- 2.43.0