mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
FRM: fix a crucial bug in perl-firmata parser skipping single 0x30 bytes on fast machines
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@6169 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2f07c2ee54
commit
df2dd3ac6a
@ -15,11 +15,11 @@ Device::Firmata - Perl interface to Firmata for the arduino platform.
|
|||||||
|
|
||||||
=head1 VERSION
|
=head1 VERSION
|
||||||
|
|
||||||
Version 0.56
|
Version 0.59
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
our $VERSION = '0.56';
|
our $VERSION = '0.59';
|
||||||
our $DEBUG = 0;
|
our $DEBUG = 0;
|
||||||
|
|
||||||
|
|
||||||
@ -27,11 +27,14 @@ our $DEBUG = 0;
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Device::Firmata::Constants qw/ :all /;
|
use Device::Firmata::Constants qw/ :all /;
|
||||||
use Device::Firmata;
|
use Device::Firmata;
|
||||||
$|++;
|
|
||||||
use Time::HiRes 'sleep';
|
use Time::HiRes 'sleep';
|
||||||
|
|
||||||
|
$|++;
|
||||||
|
|
||||||
my $led_pin = 13;
|
my $led_pin = 13;
|
||||||
|
|
||||||
my $device = Device::Firmata->open('/dev/ttyUSB0') or die "Could not connect to Firmata Server";
|
my $device = Device::Firmata->open('/dev/ttyUSB0') or die "Could not connect to Firmata Server";
|
||||||
|
@ -843,8 +843,8 @@ sub poll {
|
|||||||
|
|
||||||
# --------------------------------------------------
|
# --------------------------------------------------
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $buf = $self->{io}->data_read(2048) or return;
|
my $buf = $self->{io}->data_read(2048);
|
||||||
my $messages = $self->{protocol}->message_data_receive($buf);
|
my $messages = $self->{protocol}->message_data_receive($buf) or return;
|
||||||
$self->messages_handle($messages);
|
$self->messages_handle($messages);
|
||||||
return $messages;
|
return $messages;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user