projects
/
x300-pci
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
add toggle pin
[x300-pci]
/
gpio.pl
diff --git
a/gpio.pl
b/gpio.pl
index
9b97bc5
..
95425a3
100755
(executable)
--- a/
gpio.pl
+++ b/
gpio.pl
@@
-23,6
+23,14
@@
foreach (@gpio) {
}
my $cmd = <STDIN>;
+chomp $cmd;
+if ( $cmd =~ m/^(\d+)$/ ) {
+ my $v = `gpio -g read $1`;
+ warn "# pin $1 ", $v;
+ $v ^= 1;
+ system "gpio -g write $1 $v";
+}
+
} #/while