From 3ffe8b32f62b6a7bd04ccf99c83c229a63a3bf9d Mon Sep 17 00:00:00 2001 From: Tomasz Duda Date: Tue, 7 May 2024 15:54:51 +0200 Subject: [PATCH] add uart1 to logger --- esphome/components/logger/__init__.py | 2 ++ esphome/components/logger/logger_zephyr.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/esphome/components/logger/__init__.py b/esphome/components/logger/__init__.py index 0699a3e551..e9775d6969 100644 --- a/esphome/components/logger/__init__.py +++ b/esphome/components/logger/__init__.py @@ -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) diff --git a/esphome/components/logger/logger_zephyr.cpp b/esphome/components/logger/logger_zephyr.cpp index 631879e246..2810aa0b52 100644 --- a/esphome/components/logger/logger_zephyr.cpp +++ b/esphome/components/logger/logger_zephyr.cpp @@ -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)) {