From: Mathias Kresin Date: Sun, 14 Jan 2018 23:28:03 +0000 (+0100) Subject: base-files: gpio switch: fix inverted logic X-Git-Tag: v18.06.0-rc1~1207 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=f476c9a7458f9a1da876df02cce065f9cdeedd87;p=openwrt%2Fstaging%2Fxback.git base-files: gpio switch: fix inverted logic GPIOs are exported as active high to the sysfs, hence the logic need to be inverted. Fixes: e66c47fb14f5 ("base-files: gpio switch: set output value with direction") Signed-off-by: Mathias Kresin --- diff --git a/package/base-files/files/etc/init.d/gpio_switch b/package/base-files/files/etc/init.d/gpio_switch index b67950a992..32c142f110 100755 --- a/package/base-files/files/etc/init.d/gpio_switch +++ b/package/base-files/files/etc/init.d/gpio_switch @@ -24,7 +24,7 @@ load_gpio_switch() [ -d "$gpio_path" ] || sleep 1 } # set the pin to output with high or low pin value - { [ "$value" = "0" ] && echo "high" || echo "low"; } >"$gpio_path/direction" + { [ "$value" = "0" ] && echo "low" || echo "high"; } >"$gpio_path/direction" } service_triggers()