]> jspc29.x-matter.uni-frankfurt.de Git - avr.git/commitdiff
extend timeout for long chains
authorJan Michel <michel@physik.uni-frankfurt.de>
Wed, 11 Jan 2023 09:11:22 +0000 (10:11 +0100)
committerJan Michel <michel@physik.uni-frankfurt.de>
Wed, 11 Jan 2023 09:11:22 +0000 (10:11 +0100)
atmega32u4/dcdc_mdc/mdc_powerboard.pl

index 072aca853f143db909b54fb71445b755d269c850..36f3731d8bda372da2cb94e0e24ab00e57384bb6 100755 (executable)
@@ -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));