Manage multiple motor pins in motheure-simple/source/loop

This commit is contained in:
xdrm-brackets 2017-10-14 16:29:48 +02:00
parent 59103b79f9
commit e7a7596aac
1 changed files with 8 additions and 4 deletions

View File

@ -145,10 +145,14 @@
/* [2] Set up GPIO pin /* [2] Set up GPIO pin
=========================================================*/ =========================================================*/
/* (1) Set as input */ /* (1) Set all inputs as inputs */
if( !syscall(SOURCE_DIR."/lib/gpio/in $MOTOR_PIN") ){ foreach($MOTOR_PIN as $PIN){
slog('Cannot set up motor pin as INPUT', 'motheure-simple:setup');
return 127; if( !syscall(SOURCE_DIR."/lib/gpio/in $PIN") ){
slog("Cannot set up motor pin $PIN as INPUT", 'motheure-simple:setup');
return 127;
}
} }