diff --git a/lib/chip/source/state.php b/lib/chip/source/state.php index a94556a..19278c9 100755 --- a/lib/chip/source/state.php +++ b/lib/chip/source/state.php @@ -59,8 +59,9 @@ =========================================================*/ /* (1) Activate pin + set OUT mode */ foreach($g_pins as $pinNumber) + // if failed -> propagate error - if( syscall(SOURCE_DIR."/gpio/out {$pinNumber}") == false ) + if( syscall(SOURCE_DIR."/lib/gpio/out {$pinNumber}") == false ) return 127; /* (2) For each pin, set the associated value */ @@ -68,12 +69,12 @@ // {1} set value to LOW if 0 // if( $pinValue == 0 ) - if( syscall(SOURCE_DIR."/gpio/low ".$g_pins[$pinIndex]) == false ) + if( syscall(SOURCE_DIR."/lib/gpio/low ".$g_pins[$pinIndex]) == false ) return 127; // {2} set value to HIGH if not 0 // else - if( syscall(SOURCE_DIR."/gpio/high ".$g_pins[$pinIndex]) == false ) + if( syscall(SOURCE_DIR."/lib/gpio/high ".$g_pins[$pinIndex]) == false ) return 127; } diff --git a/lib/include/php/func b/lib/include/php/func index 5100794..d44140f 100755 --- a/lib/include/php/func +++ b/lib/include/php/func @@ -15,7 +15,7 @@ $out = preg_replace('/\s+$/', '', $out); /* (4) Manage result */ - if( is_numeric($out) ) return ($out==0); + if( is_numeric($out) ) return ("$out"==="0"); else return $out; }