mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
fix init that was broken by yesterdays change to 10_FRM
git-svn-id: https://svn.fhem.de/fhem/trunk@2865 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
30358f441a
commit
d906cf1b33
@ -26,17 +26,17 @@ FRM_I2C_Init($)
|
|||||||
my ($hash,$args) = @_;
|
my ($hash,$args) = @_;
|
||||||
my $u = "wrong syntax: define <name> FRM_I2C address register numbytes";
|
my $u = "wrong syntax: define <name> FRM_I2C address register numbytes";
|
||||||
|
|
||||||
return $u if(int(@$args) < 5);
|
return $u if(int(@$args) < 3);
|
||||||
|
|
||||||
$hash->{"i2c-address"} = @$args[2];
|
$hash->{"i2c-address"} = @$args[0];
|
||||||
$hash->{"i2c-register"} = @$args[3];
|
$hash->{"i2c-register"} = @$args[1];
|
||||||
$hash->{"i2c-bytestoread"} = @$args[4];
|
$hash->{"i2c-bytestoread"} = @$args[2];
|
||||||
|
|
||||||
return "no IODev set" unless defined $hash->{IODev};
|
return "no IODev set" unless defined $hash->{IODev};
|
||||||
return "no FirmataDevice assigned to ".$hash->{IODev}->{NAME} unless defined $hash->{IODev}->{FirmataDevice};
|
return "no FirmataDevice assigned to ".$hash->{IODev}->{NAME} unless defined $hash->{IODev}->{FirmataDevice};
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
$hash->{IODev}->{FirmataDevice}->i2c_read(@$args[2],@$args[3],@$args[4]);
|
$hash->{IODev}->{FirmataDevice}->i2c_read(@$args[0],@$args[1],@$args[2]);
|
||||||
};
|
};
|
||||||
return "error calling i2c_read: ".$@ if ($@);
|
return "error calling i2c_read: ".$@ if ($@);
|
||||||
return undef;
|
return undef;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user