Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add USB host support for esp32s2(s3), support OTG dual-mode #2922

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Sming/Arch/Esp32/Components/driver/include/driver/hw_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
#include <stdint.h>
#include <esp_idf_version.h>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#if CONFIG_ESP_TIMER_IMPL_TG0_LAC
#include <soc/timer_group_reg.h>
#else
#include <hal/systimer_ll.h>
#endif
#pragma GCC diagnostic pop

#ifdef __cplusplus
extern "C" {
Expand Down
7 changes: 6 additions & 1 deletion Sming/Arch/Esp32/Components/esp32/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 += \
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion samples/Basic_IFS/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading