in/out /lib/gpio optimization (not if already good mode)
This commit is contained in:
parent
3378985937
commit
7762f3d4c8
|
@ -32,7 +32,7 @@ test -d /sys/class/gpio/gpio$1 || echo $1 > /sys/class/gpio/export;
|
|||
|
||||
# [4] Set mode to OUT
|
||||
#========================================================#
|
||||
echo "in" > /sys/class/gpio/gpio$1/direction;
|
||||
icat /sys/class/gpio/gpio$1/direction | grep -v "in" && echo "in" > /sys/class/gpio/gpio$1/direction;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ test -d /sys/class/gpio/gpio$1 || echo $1 > /sys/class/gpio/export;
|
|||
|
||||
# [4] Set mode to OUT
|
||||
#========================================================#
|
||||
echo "out" > /sys/class/gpio/gpio$1/direction;
|
||||
icat /sys/class/gpio/gpio$1/direction | grep -v "out" && echo "out" > /sys/class/gpio/gpio$1/direction;
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue