mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
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
This commit is contained in:
parent
e9282fb762
commit
7170073569
@ -398,15 +398,15 @@ sub pin_mode {
|
|||||||
|
|
||||||
( $mode == PIN_INPUT or $mode == PIN_OUTPUT ) and do {
|
( $mode == PIN_INPUT or $mode == PIN_OUTPUT ) and do {
|
||||||
my $port_number = $pin >> 3;
|
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( SET_PIN_MODE => 0, $pin, $mode ));
|
||||||
|
$self->{io}->data_write($self->{protocol}->message_prepare( REPORT_DIGITAL => $port_number, 1 ));
|
||||||
last;
|
last;
|
||||||
};
|
};
|
||||||
|
|
||||||
$mode == PIN_ANALOG and do {
|
$mode == PIN_ANALOG and do {
|
||||||
my $port_number = $pin >> 3;
|
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( SET_PIN_MODE => 0, $pin, $mode ));
|
||||||
|
$self->{io}->data_write($self->{protocol}->message_prepare( REPORT_ANALOG => $port_number, 1 ));
|
||||||
last;
|
last;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user