mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 23:18:10 +01:00
parent
44d609b205
commit
896af84acc
1 changed files with 3 additions and 2 deletions
|
@ -57,7 +57,7 @@ optional<uint8_t> ImprovSerialComponent::read_byte_() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef USE_LOGGER_USB_CDC
|
#if defined(USE_LOGGER_USB_CDC) && defined(CONFIG_ESP_CONSOLE_USB_CDC)
|
||||||
case logger::UART_SELECTION_USB_CDC:
|
case logger::UART_SELECTION_USB_CDC:
|
||||||
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
|
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
|
||||||
if (esp_usb_console_available_for_read()) {
|
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
|
#endif // !USE_ESP32_VARIANT_ESP32C3 && !USE_ESP32_VARIANT_ESP32S2 && !USE_ESP32_VARIANT_ESP32S3
|
||||||
uart_write_bytes(this->uart_num_, data.data(), data.size());
|
uart_write_bytes(this->uart_num_, data.data(), data.size());
|
||||||
break;
|
break;
|
||||||
#ifdef USE_LOGGER_USB_CDC
|
#if defined(USE_LOGGER_USB_CDC) && defined(CONFIG_ESP_CONSOLE_USB_CDC)
|
||||||
case logger::UART_SELECTION_USB_CDC: {
|
case logger::UART_SELECTION_USB_CDC: {
|
||||||
const char *msg = (char *) data.data();
|
const char *msg = (char *) data.data();
|
||||||
esp_usb_console_write_buf(msg, data.size());
|
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
|
#ifdef USE_LOGGER_USB_SERIAL_JTAG
|
||||||
case logger::UART_SELECTION_USB_SERIAL_JTAG:
|
case logger::UART_SELECTION_USB_SERIAL_JTAG:
|
||||||
usb_serial_jtag_write_bytes((char *) data.data(), data.size(), 20 / portTICK_PERIOD_MS);
|
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
|
usb_serial_jtag_ll_txfifo_flush(); // fixes for issue in IDF 4.4.7
|
||||||
break;
|
break;
|
||||||
#endif // USE_LOGGER_USB_SERIAL_JTAG
|
#endif // USE_LOGGER_USB_SERIAL_JTAG
|
||||||
|
|
Loading…
Reference in a new issue