1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-05 18:30:28 +01:00

add uart1 to logger

This commit is contained in:
Tomasz Duda 2024-05-07 15:54:51 +02:00
parent 8234c45194
commit 3ffe8b32f6
2 changed files with 5 additions and 0 deletions

View File

@ -310,6 +310,8 @@ async def to_code(config):
if CORE.using_zephyr:
if config[CONF_HARDWARE_UART] == UART0:
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:
zephyr_add_prj_conf("UART_LINE_CTRL", True)
zephyr_add_cdc_acm(config)

View File

@ -39,6 +39,9 @@ void Logger::pre_setup() {
case UART_SELECTION_UART0:
uart_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(uart0));
break;
case UART_SELECTION_UART1:
uart_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(uart1));
break;
case UART_SELECTION_USB_CDC:
uart_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(cdc_acm_uart0));
if (device_is_ready(uart_dev)) {