mirror of
https://github.com/esphome/esphome.git
synced 2025-04-06 10:50:28 +01:00
add uart1 to logger
This commit is contained in:
parent
8234c45194
commit
3ffe8b32f6
@ -310,6 +310,8 @@ async def to_code(config):
|
|||||||
if CORE.using_zephyr:
|
if CORE.using_zephyr:
|
||||||
if config[CONF_HARDWARE_UART] == UART0:
|
if config[CONF_HARDWARE_UART] == UART0:
|
||||||
zephyr_add_overlay("""&uart0 { status = "okay";};""")
|
zephyr_add_overlay("""&uart0 { status = "okay";};""")
|
||||||
|
if config[CONF_HARDWARE_UART] == UART1:
|
||||||
|
zephyr_add_overlay("""&uart1 { status = "okay";};""")
|
||||||
if config[CONF_HARDWARE_UART] == USB_CDC:
|
if config[CONF_HARDWARE_UART] == USB_CDC:
|
||||||
zephyr_add_prj_conf("UART_LINE_CTRL", True)
|
zephyr_add_prj_conf("UART_LINE_CTRL", True)
|
||||||
zephyr_add_cdc_acm(config)
|
zephyr_add_cdc_acm(config)
|
||||||
|
@ -39,6 +39,9 @@ void Logger::pre_setup() {
|
|||||||
case UART_SELECTION_UART0:
|
case UART_SELECTION_UART0:
|
||||||
uart_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(uart0));
|
uart_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(uart0));
|
||||||
break;
|
break;
|
||||||
|
case UART_SELECTION_UART1:
|
||||||
|
uart_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(uart1));
|
||||||
|
break;
|
||||||
case UART_SELECTION_USB_CDC:
|
case UART_SELECTION_USB_CDC:
|
||||||
uart_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(cdc_acm_uart0));
|
uart_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(cdc_acm_uart0));
|
||||||
if (device_is_ready(uart_dev)) {
|
if (device_is_ready(uart_dev)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user