From b8f7051285395d069888cb27018ac507600c9db1 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 20 Feb 2017 23:05:35 +0100 Subject: [PATCH] Update --- lib/chip/source/state.php | 7 +++++-- lib/gpio/high | 2 +- lib/gpio/low | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/chip/source/state.php b/lib/chip/source/state.php index 19278c9..9c4c2ca 100755 --- a/lib/chip/source/state.php +++ b/lib/chip/source/state.php @@ -68,14 +68,17 @@ foreach($g_state as $pinIndex=>$pinValue){ // {1} set value to LOW if 0 // - if( $pinValue == 0 ) + if( $pinValue == 0 ){ + if( syscall(SOURCE_DIR."/lib/gpio/low ".$g_pins[$pinIndex]) == false ) return 127; // {2} set value to HIGH if not 0 // - else + }else{ + if( syscall(SOURCE_DIR."/lib/gpio/high ".$g_pins[$pinIndex]) == false ) return 127; + } } diff --git a/lib/gpio/high b/lib/gpio/high index b38f1c5..a926790 100755 --- a/lib/gpio/high +++ b/lib/gpio/high @@ -32,7 +32,7 @@ test -d /sys/class/gpio/gpio$1 || echo $1 > /sys/class/gpio/export; # [4] Set mode to OUT #========================================================# -echo 1 > /sys/class/gpio/gpio$1/value; +echo "1" > /sys/class/gpio/gpio$1/value; diff --git a/lib/gpio/low b/lib/gpio/low index db7a24e..1326a8c 100755 --- a/lib/gpio/low +++ b/lib/gpio/low @@ -32,7 +32,7 @@ test -d /sys/class/gpio/gpio$1 || echo $1 > /sys/class/gpio/export; # [4] Set mode to OUT #========================================================# -echo 0 > /sys/class/gpio/gpio$1/value; +echo "0" > /sys/class/gpio/gpio$1/value;