mirror of
https://github.com/esphome/esphome.git
synced 2024-11-13 10:25:03 +01:00
parent
44d609b205
commit
896af84acc
@ -57,7 +57,7 @@ optional<uint8_t> ImprovSerialComponent::read_byte_() {
|
||||
}
|
||||
}
|
||||
break;
|
||||
#ifdef USE_LOGGER_USB_CDC
|
||||
#if defined(USE_LOGGER_USB_CDC) && defined(CONFIG_ESP_CONSOLE_USB_CDC)
|
||||
case logger::UART_SELECTION_USB_CDC:
|
||||
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
|
||||
if (esp_usb_console_available_for_read()) {
|
||||
@ -99,7 +99,7 @@ void ImprovSerialComponent::write_data_(std::vector<uint8_t> &data) {
|
||||
#endif // !USE_ESP32_VARIANT_ESP32C3 && !USE_ESP32_VARIANT_ESP32S2 && !USE_ESP32_VARIANT_ESP32S3
|
||||
uart_write_bytes(this->uart_num_, data.data(), data.size());
|
||||
break;
|
||||
#ifdef USE_LOGGER_USB_CDC
|
||||
#if defined(USE_LOGGER_USB_CDC) && defined(CONFIG_ESP_CONSOLE_USB_CDC)
|
||||
case logger::UART_SELECTION_USB_CDC: {
|
||||
const char *msg = (char *) data.data();
|
||||
esp_usb_console_write_buf(msg, data.size());
|
||||
@ -109,6 +109,7 @@ void ImprovSerialComponent::write_data_(std::vector<uint8_t> &data) {
|
||||
#ifdef USE_LOGGER_USB_SERIAL_JTAG
|
||||
case logger::UART_SELECTION_USB_SERIAL_JTAG:
|
||||
usb_serial_jtag_write_bytes((char *) data.data(), data.size(), 20 / portTICK_PERIOD_MS);
|
||||
delay(10);
|
||||
usb_serial_jtag_ll_txfifo_flush(); // fixes for issue in IDF 4.4.7
|
||||
break;
|
||||
#endif // USE_LOGGER_USB_SERIAL_JTAG
|
||||
|
Loading…
Reference in New Issue
Block a user