pytools/gpioutil: Don't set direction if already set

Writing "out" to GPIO direction will actually clear the output value.
This makes it impossible to read the value of outputs with gpioutil
since it always sets value to 0 before reading it.

Fix: don't write direction if the direction already matches that
requested.

Change-Id: I2116e6c7f5800239dd89c4f47fe7fd087b3a87cd
Signed-off-by: Xo Wang <xow@google.com>
1 file changed