From c966fe607e3beddaa6939030fada35486a6b32f5 Mon Sep 17 00:00:00 2001 From: Jaroslav Burian Date: Mon, 4 Nov 2024 12:26:11 +0100 Subject: [PATCH 1/2] fix: Callback when USB port is disconnected Callback function was not being called when USB port was disconnected. The deinit function removed the callback function from the USB driver, deinit function is now after the callback function is called. --- port/esp32_usb_cdc_acm_port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/port/esp32_usb_cdc_acm_port.c b/port/esp32_usb_cdc_acm_port.c index 2a3e62a..5af0ab8 100644 --- a/port/esp32_usb_cdc_acm_port.c +++ b/port/esp32_usb_cdc_acm_port.c @@ -64,11 +64,11 @@ static void handle_usb_event(const cdc_acm_host_dev_event_data_t *event, void *u case CDC_ACM_HOST_DEVICE_DISCONNECTED: ESP_LOGI(TAG, "Device disconnected"); - esp_loader_error_t deinit_status = loader_port_esp32_usb_cdc_acm_deinit(); - assert(deinit_status == ESP_LOADER_SUCCESS); if (s_device_disconnected_callback != NULL) { s_device_disconnected_callback(); } + esp_loader_error_t deinit_status = loader_port_esp32_usb_cdc_acm_deinit(); + assert(deinit_status == ESP_LOADER_SUCCESS); break; case CDC_ACM_HOST_SERIAL_STATE: From 53fb930b7d61bdd0fd5922bcd9b4e5919721a1f3 Mon Sep 17 00:00:00 2001 From: Jaroslav Burian Date: Mon, 4 Nov 2024 12:49:13 +0100 Subject: [PATCH 2/2] docs: Remove experimental note for USB port --- Kconfig | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Kconfig b/Kconfig index 0ff71c7..7f3172d 100644 --- a/Kconfig +++ b/Kconfig @@ -18,7 +18,7 @@ menu "ESP serial flasher" bool "SPI (Only supports downloading to RAM)" config SERIAL_FLASHER_INTERFACE_USB - bool "USB (Experimental)" + bool "USB" endchoice diff --git a/README.md b/README.md index 60e765b..6fa1cc7 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Supported **target** microcontrollers: Supported hardware interfaces: - UART - SPI (only for RAM download) -- USB CDC ACM (experimental) +- USB CDC ACM For example usage check the [examples](/examples) directory.