]> jspc29.x-matter.uni-frankfurt.de Git - labtools.git/commitdiff
add some stty settings, add delay to work on raspi
authorJan Michel <j.michel@gsi.de>
Thu, 2 Nov 2017 17:04:12 +0000 (18:04 +0100)
committerJan Michel <j.michel@gsi.de>
Thu, 2 Nov 2017 17:04:25 +0000 (18:04 +0100)
powersupplies/web/htdocs/pwr.pl

index 561678d814ad3129aea671e8afd351f568351bb2..06f2a6cf7b9a9e38d0fdee7c650825ab6f0d890d 100755 (executable)
@@ -57,7 +57,8 @@ if($ser_dev =~ /^IP(.*)/) {
 #   }
 else {  
   if ($ser_speed != 0){
-    my $command = "stty -F $ser_dev speed $ser_speed";
+      my $command = "stty -F $ser_dev speed $ser_speed -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke";
+      print stderr "$command\n";
     $command .= " -ixoff " if $ser_type eq 'PSP';
     my $res = qx($command);
     }
@@ -173,7 +174,7 @@ sub HMP_serial {
     my $x = getValue($fh,$command,$cnt++);
     $x =~ s/\&//;
     print $x."&" if $command =~ /\?/;
-    usleep(40000) if $ser_type eq "PST";
+    usleep(40000);# if $ser_type eq "PST";
     }
   close $fh;  
   return;
@@ -221,7 +222,7 @@ sub serial_rw {
 
 sub getValue {
   my ($fh,$cmd,$cnt,$forceread) = @_;
-  if (0 && defined $db->{$cmd.$cnt}{tim} && $db->{$cmd.$cnt}{tim} > time()-2) {
+  if (0 && defined $db->{$cmd.$cnt}{tim} && $db->{$cmd.$cnt}{tim} > time()-10) {
     return $db->{$cmd.$cnt}{val};
     }
   else {