Fix uart to work with new enum definition in esp-idf-v5.2.1 (#6487)

This commit is contained in:
luar123 2024-04-17 06:57:26 +02:00 committed by GitHub
parent 83feae4eb2
commit 6104e7591e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
} }