From e0d7d395d7ec1297152dea8fb0cdadc92beed37f Mon Sep 17 00:00:00 2001 From: mikee47 Date: Sun, 1 Dec 2024 11:40:18 +0000 Subject: [PATCH 1/3] Include `usb` component from IDF --- Sming/Arch/Esp32/Components/esp32/component.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sming/Arch/Esp32/Components/esp32/component.mk b/Sming/Arch/Esp32/Components/esp32/component.mk index eaf4804398..66ed206cba 100644 --- a/Sming/Arch/Esp32/Components/esp32/component.mk +++ b/Sming/Arch/Esp32/Components/esp32/component.mk @@ -117,7 +117,8 @@ SDK_INCDIRS := \ esp_netif/include \ esp_eth/include \ esp_wifi/include \ - lwip/include/apps/sntp + lwip/include/apps/sntp \ + usb/include ifdef IDF_VERSION_4x SDK_INCDIRS += \ @@ -262,6 +263,10 @@ SDK_COMPONENTS := \ soc \ spi_flash +ifneq (,$(filter esp32s2 esp32s3,$(SMING_SOC))) +SDK_COMPONENTS += usb +endif + ifdef IDF_VERSION_43 SDK_COMPONENTS += $(ESP_VARIANT) else From ae996903e1e704d8d3597ca48d5d163e2289b2b2 Mon Sep 17 00:00:00 2001 From: mikee47 Date: Thu, 12 Dec 2024 13:45:50 +0000 Subject: [PATCH 2/3] Hide unused parameter warnings --- Sming/Arch/Esp32/Components/driver/include/driver/hw_timer.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sming/Arch/Esp32/Components/driver/include/driver/hw_timer.h b/Sming/Arch/Esp32/Components/driver/include/driver/hw_timer.h index 1979b45072..623bc5de29 100644 --- a/Sming/Arch/Esp32/Components/driver/include/driver/hw_timer.h +++ b/Sming/Arch/Esp32/Components/driver/include/driver/hw_timer.h @@ -15,11 +15,14 @@ #include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" #if CONFIG_ESP_TIMER_IMPL_TG0_LAC #include #else #include #endif +#pragma GCC diagnostic pop #ifdef __cplusplus extern "C" { From df55bc42d2587122d521da7569f2ffa845ec1446 Mon Sep 17 00:00:00 2001 From: mikee47 Date: Thu, 12 Dec 2024 13:46:37 +0000 Subject: [PATCH 3/3] Update USB library with esp32sx host and OTG dual-mode support `USB::begin()` now requires parameter indicating mode (device or host) --- Sming/Libraries/USB | 2 +- samples/Basic_IFS/app/application.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sming/Libraries/USB b/Sming/Libraries/USB index 0717652a30..6af107fbe2 160000 --- a/Sming/Libraries/USB +++ b/Sming/Libraries/USB @@ -1 +1 @@ -Subproject commit 0717652a3095a3091d5bb56ed683474b2d72f0bf +Subproject commit 6af107fbe25f7a8cb154ccea6ce9fb69e34dc60b diff --git a/samples/Basic_IFS/app/application.cpp b/samples/Basic_IFS/app/application.cpp index 8602249330..acaf936a8f 100644 --- a/samples/Basic_IFS/app/application.cpp +++ b/samples/Basic_IFS/app/application.cpp @@ -246,7 +246,7 @@ bool initFileSystem() #endif #ifdef ENABLE_USB_STORAGE - USB::begin(); + USB::begin(true); USB::MSC::onMount([](auto inst) { usbStorage.begin(inst); usbStorage.enumerate([](auto& unit, const USB::MSC::Inquiry& inquiry) {