mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 17:54:13 +01:00
Fix uart to work with new enum definition in esp-idf-v5.2.1 (#6487)
This commit is contained in:
parent
83feae4eb2
commit
6104e7591e
1 changed files with 3 additions and 5 deletions
|
@ -120,30 +120,28 @@ void Logger::pre_setup() {
|
||||||
switch (this->uart_) {
|
switch (this->uart_) {
|
||||||
case UART_SELECTION_UART0:
|
case UART_SELECTION_UART0:
|
||||||
this->uart_num_ = UART_NUM_0;
|
this->uart_num_ = UART_NUM_0;
|
||||||
|
init_uart(this->uart_num_, baud_rate_, tx_buffer_size_);
|
||||||
break;
|
break;
|
||||||
case UART_SELECTION_UART1:
|
case UART_SELECTION_UART1:
|
||||||
this->uart_num_ = UART_NUM_1;
|
this->uart_num_ = UART_NUM_1;
|
||||||
|
init_uart(this->uart_num_, baud_rate_, tx_buffer_size_);
|
||||||
break;
|
break;
|
||||||
#ifdef USE_ESP32_VARIANT_ESP32
|
#ifdef USE_ESP32_VARIANT_ESP32
|
||||||
case UART_SELECTION_UART2:
|
case UART_SELECTION_UART2:
|
||||||
this->uart_num_ = UART_NUM_2;
|
this->uart_num_ = UART_NUM_2;
|
||||||
|
init_uart(this->uart_num_, baud_rate_, tx_buffer_size_);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_LOGGER_USB_CDC
|
#ifdef USE_LOGGER_USB_CDC
|
||||||
case UART_SELECTION_USB_CDC:
|
case UART_SELECTION_USB_CDC:
|
||||||
this->uart_num_ = -1;
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_LOGGER_USB_SERIAL_JTAG
|
#ifdef USE_LOGGER_USB_SERIAL_JTAG
|
||||||
case UART_SELECTION_USB_SERIAL_JTAG:
|
case UART_SELECTION_USB_SERIAL_JTAG:
|
||||||
this->uart_num_ = -1;
|
|
||||||
init_usb_serial_jtag_();
|
init_usb_serial_jtag_();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (this->uart_num_ >= 0) {
|
|
||||||
init_uart(this->uart_num_, baud_rate_, tx_buffer_size_);
|
|
||||||
}
|
|
||||||
#endif // USE_ESP_IDF
|
#endif // USE_ESP_IDF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue