Skip to content

Commit

Permalink
Don't define UART_SELECTION_UART2 when UART2 is unavailable (esphome#…
Browse files Browse the repository at this point in the history
  • Loading branch information
oxan authored Oct 14, 2021
1 parent 8823024 commit 63d6b61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions esphome/components/logger/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void Logger::pre_setup() {
case UART_SELECTION_UART1:
this->hw_serial_ = &Serial1;
break;
#if defined(USE_ESP32) && !CONFIG_IDF_TARGET_ESP32C3 && !CONFIG_IDF_TARGET_ESP32S2
#if defined(USE_ESP32) && !defined(USE_ESP32_VARIANT_ESP32C3) && !defined(USE_ESP32_VARIANT_ESP32S2)
case UART_SELECTION_UART2:
this->hw_serial_ = &Serial2;
break;
Expand All @@ -169,7 +169,7 @@ void Logger::pre_setup() {
case UART_SELECTION_UART1:
uart_num_ = UART_NUM_1;
break;
#if !CONFIG_IDF_TARGET_ESP32C3 && !CONFIG_IDF_TARGET_ESP32S2
#if defined(USE_ESP32) && !defined(USE_ESP32_VARIANT_ESP32C3) && !defined(USE_ESP32_VARIANT_ESP32S2)
case UART_SELECTION_UART2:
uart_num_ = UART_NUM_2;
break;
Expand Down
2 changes: 1 addition & 1 deletion esphome/components/logger/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace logger {
enum UARTSelection {
UART_SELECTION_UART0 = 0,
UART_SELECTION_UART1,
#ifdef USE_ESP32
#if defined(USE_ESP32) && !defined(USE_ESP32_VARIANT_ESP32C3) && !defined(USE_ESP32_VARIANT_ESP32S2)
UART_SELECTION_UART2,
#endif
#ifdef USE_ESP8266
Expand Down

0 comments on commit 63d6b61

Please sign in to comment.