Skip to content

Commit 6e589f6

Browse files
committed
Merge branch 'fix/usb_otg_switch_example' into 'master'
fix(usb_otg): use tusb_teardown instead of tud_deinit See merge request ae_group/esp-iot-solution!1306
2 parents 9e0e4b0 + ef5ff23 commit 6e589f6

File tree

8 files changed

+15
-4
lines changed

8 files changed

+15
-4
lines changed

components/usb/esp_msc_ota/esp_msc_host.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static void usb_event_task(void *args)
184184

185185
// Clean up USB Host
186186
vTaskDelay(100); // Short delay to allow clients clean-up
187-
usb_host_uninstall();
187+
ESP_ERROR_CHECK(usb_host_uninstall());
188188
ESP_LOGD(TAG, "USB Host library is uninstalled");
189189
xEventGroupSetBits(msc_host->usb_flags, HOST_UNINSTALL);
190190
vTaskDelete(NULL);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
CONFIG_EXAMPLE_AUTO_UPDATE_DNS=n
22
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_2m_app.csv"
33
CONFIG_SLAVE_IDF_TARGET_ESP32C6=y
4+
CONFIG_EPPP_LINK_USES_PPP=y
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
CONFIG_SLAVE_IDF_TARGET_ESP32C6=y
2+
CONFIG_EPPP_LINK_USES_PPP=y

examples/usb/host/usb_hub_dual_camera/sdkconfig.defaults.esp32p4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ CONFIG_LWIP_UDP_RECVMBOX_SIZE=64
2727
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64
2828

2929
CONFIG_LWIP_TCP_SACK_OUT=y
30+
CONFIG_EPPP_LINK_USES_PPP=y
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
CONFIG_SLAVE_IDF_TARGET_ESP32C6=y
2+
CONFIG_EPPP_LINK_USES_PPP=y

examples/usb/otg/usb_host_device_mode_manual_switch/main/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77
version: "^4.0.0"
88
override_path: ../../../../../components/button
99
espressif/tinyusb:
10-
version: "0.17.*"
10+
version: "0.18.*"
1111
## Required IDF version
1212
idf:
1313
version: ">=5.0"

examples/usb/otg/usb_host_device_mode_manual_switch/main/manual_switch.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
#include "usb_device_cdc.h"
1212
#include "iot_button.h"
1313
#include "button_gpio.h"
14+
#include "driver/gpio.h"
15+
16+
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32S2
17+
#define BOOT_GPIO GPIO_NUM_0
18+
#elif CONFIG_IDF_TARGET_ESP32P4
19+
#define BOOT_GPIO GPIO_NUM_35
20+
#endif
1421

1522
static const char *TAG = "manual_switch";
1623

@@ -40,7 +47,7 @@ static void usb_otg_mode_switch_init(void)
4047
{
4148
const button_config_t btn_cfg = {0};
4249
const button_gpio_config_t btn_gpio_cfg = {
43-
.gpio_num = 0,
50+
.gpio_num = BOOT_GPIO,
4451
.active_level = 0,
4552
};
4653
button_handle_t btn = NULL;

examples/usb/otg/usb_host_device_mode_manual_switch/main/usb_device_cdc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ esp_err_t device_cdc_init(void)
9191
esp_err_t device_cdc_deinit(void)
9292
{
9393
esp_err_t ret = ESP_OK;
94-
tud_deinit(0);
94+
tusb_teardown();
9595
vTaskDelete(uvc_task_hdl);
9696
vTaskDelete(cdc_task_hdl);
9797
usb_del_phy(phy_hdl);

0 commit comments

Comments
 (0)