From 71700735699843289f05ffb9ca0c6776aa2fad13 Mon Sep 17 00:00:00 2001 From: ntruchsess <> Date: Fri, 22 Nov 2013 16:37:48 +0000 Subject: [PATCH] FRM: swap calls to set_pin_mode and report_digital/analog to trigger a message git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@4263 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/lib/Device/Firmata/Platform.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FHEM/lib/Device/Firmata/Platform.pm b/FHEM/lib/Device/Firmata/Platform.pm index bba7c36d2..ddd4e6c20 100644 --- a/FHEM/lib/Device/Firmata/Platform.pm +++ b/FHEM/lib/Device/Firmata/Platform.pm @@ -398,15 +398,15 @@ sub pin_mode { ( $mode == PIN_INPUT or $mode == PIN_OUTPUT ) and do { my $port_number = $pin >> 3; - $self->{io}->data_write($self->{protocol}->message_prepare( REPORT_DIGITAL => $port_number, 1 )); $self->{io}->data_write($self->{protocol}->message_prepare( SET_PIN_MODE => 0, $pin, $mode )); + $self->{io}->data_write($self->{protocol}->message_prepare( REPORT_DIGITAL => $port_number, 1 )); last; }; $mode == PIN_ANALOG and do { my $port_number = $pin >> 3; - $self->{io}->data_write($self->{protocol}->message_prepare( REPORT_ANALOG => $port_number, 1 )); $self->{io}->data_write($self->{protocol}->message_prepare( SET_PIN_MODE => 0, $pin, $mode )); + $self->{io}->data_write($self->{protocol}->message_prepare( REPORT_ANALOG => $port_number, 1 )); last; };