Skip to content

Commit

Permalink
Add MTP function implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
udoudou committed Jan 24, 2024
1 parent f29e22c commit 1a494f8
Show file tree
Hide file tree
Showing 19 changed files with 2,340 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ sdkconfig.old
build
managed_components
dependencies.lock
.vscode
1 change: 1 addition & 0 deletions additions/usb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
#define CONFIG_USBDEV_EP_NUM 7
#define CONFIG_USB_DWC2_RAM_SIZE 1280
#define CONFIG_USB_DWC2_TX6_FIFO_SIZE (128)
#define CONFIG_USB_DWC2_DMA_ENABLE
#elif CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32P4
#define CONFIG_USB_HS
#define USBD_BASE 0x60080000
Expand Down
19 changes: 2 additions & 17 deletions examples/device/cherryusb_device_cdc/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
idf_component_register(SRCS
"device_cdc_main.c"
INCLUDE_DIRS
"."
idf_component_register(SRCS "device_cdc_main.c"
INCLUDE_DIRS "."
)

# Determine whether esp_cherryusb is fetched from the component registry or from the local path
idf_build_get_property(build_components BUILD_COMPONENTS)
if(esp_cherryusb IN_LIST build_components)
set(esp_cherryusb_name esp_cherryusb) # Local component
else()
set(esp_cherryusb_name udoudou__esp_cherryusb) # Managed component
endif()

# Pass usb_config.h.h from this component to esp_cherryusb
idf_component_get_property(_esp_cherryusb_lib ${esp_cherryusb_name} COMPONENT_LIB)
cmake_policy(SET CMP0079 NEW)
target_link_libraries(${_esp_cherryusb_lib} PRIVATE ${COMPONENT_LIB})
6 changes: 6 additions & 0 deletions examples/device/cherryusb_device_mtp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(cherryusb_device_mtp)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
idf_component_register(SRCS "esp_mtp.c" "esp_mtp_helper.c"
INCLUDE_DIRS "include"
PRIV_REQUIRES
)
Loading

0 comments on commit 1a494f8

Please sign in to comment.