remove physical pins
[x300-pci] / gpio.pl
diff --git a/gpio.pl b/gpio.pl
index a701ce9..f72f61d 100755 (executable)
--- a/gpio.pl
+++ b/gpio.pl
@@ -26,29 +26,32 @@ foreach (@gpio) {
        s/([ \d]{2})(...GPIO.)../$1$2$1/;
        s/(GPIO.)..(...)(\s*\d+)/$1$3$2$3/;
 
-       my $line = $_ . ( shift @pcf || '');
+       my $line = substr($_,0,29) . substr($_,39);
+       $line .= shift @pcf || '';
+
        chomp $line;
        my @l = split(/\|/, $line);
-       if ( $#l > 10 ) {
+       my @o = split(/\|/, $last[$i] || '');
+       $last[$i] = $line;
+       $i++;
+
+       if ( $#l >= 9 ) {
                no warnings;
                $mode->{ $l[1]  } = [ $l[4] + 0, $l[2], $l[3] ];
-               $mode->{ $l[11] } = [ $l[8] + 0, $l[10], $l[9] ];
-               $mode->{ $l[13] } = [ $l[14], $l[15] ] if $l[15];
+               $mode->{ $l[9]  } = [ $l[6] + 0, $l[8], $l[7] ];
+               $mode->{ $l[11] } = [ $l[12], $l[13] ] if $l[13];
                #warn "## l = ",dump(@l);
        }
        
 
        if ( $last[$i] && $line ne $last[$i] ) {
-               my @o = split(/\|/, $last[$i]);
                foreach my $i ( 0 .. $#l ) {
                        $l[$i] = "\e[33;7;1m$l[$i]\e[0m" if $l[$i] ne $o[$i];
                }
-               print join('|', @l), "|\n";
-       } else {
-               print "$line\n";
+               $line = join('|', @l) . "|";
        }
-       $last[$i] = $line;
-       $i++;
+
+       print "$line\n";
 
 }