From ab22a3da349d3d60b687cbf70dd5a00ec44b67e2 Mon Sep 17 00:00:00 2001 From: Keith Burzinski Date: Mon, 18 Dec 2023 01:33:12 -0600 Subject: [PATCH] Use the correct UART/`Serial` when CDC is enabled (#5957) --- esphome/components/logger/logger.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/logger/logger.cpp b/esphome/components/logger/logger.cpp index e0ca0806cb..05b97a5f64 100644 --- a/esphome/components/logger/logger.cpp +++ b/esphome/components/logger/logger.cpp @@ -237,8 +237,8 @@ void Logger::pre_setup() { Serial1.begin(this->baud_rate_); #else #if ARDUINO_USB_CDC_ON_BOOT - this->hw_serial_ = &Serial; - Serial.begin(this->baud_rate_); + this->hw_serial_ = &Serial0; + Serial0.begin(this->baud_rate_); #else this->hw_serial_ = &Serial; Serial.begin(this->baud_rate_);