Merge branch 'dev'
git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@4080 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -372,6 +372,16 @@ FRM_Init_Pin_Client($$$) {
|
||||
my $u = "wrong syntax: define <name> FRM_XXX pin";
|
||||
return $u unless defined $args and int(@$args) > 0;
|
||||
my $pin = @$args[0];
|
||||
|
||||
foreach my $d ( sort keys %main::defs ) {
|
||||
if ( defined( $main::defs{$d} )
|
||||
&& defined( $main::defs{$d}{IODev} )
|
||||
&& defined( $main::defs{$d}{PIN} )
|
||||
&& $main::defs{$d}{IODev} == $hash->{IODev}
|
||||
&& $main::defs{$d}{PIN} == $pin ) {
|
||||
die "Device $main::defs{$d}{NAME} allready defined for pin $pin";
|
||||
}
|
||||
}
|
||||
$hash->{PIN} = $pin;
|
||||
eval {
|
||||
FRM_Client_FirmataDevice($hash)->pin_mode($pin,$mode);
|
||||
@@ -393,9 +403,10 @@ FRM_Client_Define($$)
|
||||
$hash->{STATE}="defined";
|
||||
|
||||
AssignIoPort($hash);
|
||||
FRM_Init_Client($hash,[@a[2..scalar(@a)-1]]);
|
||||
|
||||
return undef;
|
||||
eval {
|
||||
FRM_Init_Client($hash,[@a[2..scalar(@a)-1]]);
|
||||
};
|
||||
return $@;
|
||||
}
|
||||
|
||||
sub
|
||||
|
||||
Reference in New Issue
Block a user