mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 17:54:13 +01:00
Allow split uart pin inversion for ESP-IDF (#5831)
This commit is contained in:
parent
636ee2b597
commit
c43518c391
2 changed files with 5 additions and 2 deletions
|
@ -75,12 +75,13 @@ def validate_rx_pin(value):
|
||||||
def validate_invert_esp32(config):
|
def validate_invert_esp32(config):
|
||||||
if (
|
if (
|
||||||
CORE.is_esp32
|
CORE.is_esp32
|
||||||
|
and CORE.using_arduino
|
||||||
and CONF_TX_PIN in config
|
and CONF_TX_PIN in config
|
||||||
and CONF_RX_PIN in config
|
and CONF_RX_PIN in config
|
||||||
and config[CONF_TX_PIN][CONF_INVERTED] != config[CONF_RX_PIN][CONF_INVERTED]
|
and config[CONF_TX_PIN][CONF_INVERTED] != config[CONF_RX_PIN][CONF_INVERTED]
|
||||||
):
|
):
|
||||||
raise cv.Invalid(
|
raise cv.Invalid(
|
||||||
"Different invert values for TX and RX pin are not (yet) supported for ESP32."
|
"Different invert values for TX and RX pin are not supported for ESP32 when using Arduino."
|
||||||
)
|
)
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,9 @@ uart:
|
||||||
rx_pin: 3
|
rx_pin: 3
|
||||||
baud_rate: 9600
|
baud_rate: 9600
|
||||||
- id: uart_2
|
- id: uart_2
|
||||||
tx_pin: 17
|
tx_pin:
|
||||||
|
number: 17
|
||||||
|
inverted: true
|
||||||
rx_pin: 16
|
rx_pin: 16
|
||||||
baud_rate: 19200
|
baud_rate: 19200
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue