in/out /lib/gpio optimization (not if already good mode)

This commit is contained in:
xdrm-brackets 2017-02-20 23:22:17 +01:00
parent 3378985937
commit 7762f3d4c8
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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;