Little fix (wrong syscall() links)

This commit is contained in:
xdrm-brackets 2017-02-20 22:17:48 +01:00
parent 291190475d
commit bbd4c717c5
2 changed files with 5 additions and 4 deletions

View File

@ -59,8 +59,9 @@
=========================================================*/ =========================================================*/
/* (1) Activate pin + set OUT mode */ /* (1) Activate pin + set OUT mode */
foreach($g_pins as $pinNumber) foreach($g_pins as $pinNumber)
// if failed -> propagate error // if failed -> propagate error
if( syscall(SOURCE_DIR."/gpio/out {$pinNumber}") == false ) if( syscall(SOURCE_DIR."/lib/gpio/out {$pinNumber}") == false )
return 127; return 127;
/* (2) For each pin, set the associated value */ /* (2) For each pin, set the associated value */
@ -68,12 +69,12 @@
// {1} set value to LOW if 0 // // {1} set value to LOW if 0 //
if( $pinValue == 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; return 127;
// {2} set value to HIGH if not 0 // // {2} set value to HIGH if not 0 //
else else
if( syscall(SOURCE_DIR."/gpio/high ".$g_pins[$pinIndex]) == false ) if( syscall(SOURCE_DIR."/lib/gpio/high ".$g_pins[$pinIndex]) == false )
return 127; return 127;
} }

View File

@ -15,7 +15,7 @@
$out = preg_replace('/\s+$/', '', $out); $out = preg_replace('/\s+$/', '', $out);
/* (4) Manage result */ /* (4) Manage result */
if( is_numeric($out) ) return ($out==0); if( is_numeric($out) ) return ("$out"==="0");
else return $out; else return $out;
} }