Skip to content

Commit 2320ad6

Browse files
authored
Update CMakeLists.txt
1 parent 85abe53 commit 2320ad6

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

components/arduino_tinyusb/CMakeLists.txt

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@ if(CONFIG_TINYUSB_ENABLED)
1515
"-DCFG_TUSB_DEBUG=${CONFIG_TINYUSB_DEBUG_LEVEL}"
1616
"-Wno-type-limits" # needed for the vanila tinyusb with turned off classes
1717
)
18+
elseif(IDF_TARGET STREQUAL "esp32p4")
19+
set(compile_options
20+
"-DCFG_TUSB_MCU=OPT_MCU_ESP32P4"
21+
"-DCFG_TUSB_DEBUG=${CONFIG_TINYUSB_DEBUG_LEVEL}"
22+
"-Wno-type-limits" # needed for the vanila tinyusb with turned off classes
23+
)
1824
endif()
1925

2026
set(srcs
2127
# espressif:
22-
#"${COMPONENT_DIR}/src/dcd_esp32sx.c"
2328
"${COMPONENT_DIR}/src/dcd_dwc2.c"
2429
# tusb:
25-
#"${COMPONENT_DIR}/tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c"
2630
#"{COMPONENT_DIR}/tinyusb/src/portable/synopsys/dwc2/dcd_dwc2.c"
2731
"${COMPONENT_DIR}/tinyusb/src/class/cdc/cdc_device.c"
2832
"${COMPONENT_DIR}/tinyusb/src/class/hid/hid_device.c"
@@ -32,6 +36,7 @@ if(CONFIG_TINYUSB_ENABLED)
3236
"${COMPONENT_DIR}/tinyusb/src/class/dfu/dfu_rt_device.c"
3337
"${COMPONENT_DIR}/tinyusb/src/class/dfu/dfu_device.c"
3438
"${COMPONENT_DIR}/tinyusb/src/class/vendor/vendor_device.c"
39+
"${COMPONENT_DIR}/tinyusb/src/class/net/ncm_device.c"
3540
"${COMPONENT_DIR}/tinyusb/src/common/tusb_fifo.c"
3641
"${COMPONENT_DIR}/tinyusb/src/device/usbd_control.c"
3742
"${COMPONENT_DIR}/tinyusb/src/device/usbd.c"
@@ -56,16 +61,15 @@ if(CONFIG_TINYUSB_ENABLED)
5661

5762
set(requires esp_rom freertos soc)
5863
set(priv_requires arduino main)
59-
### tinyusb lib ###
60-
###################
61-
idf_component_register(INCLUDE_DIRS ${includes_public} PRIV_INCLUDE_DIRS ${includes_private} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires})
62-
# add_library(${COMPONENT_TARGET} STATIC ${srcs})
63-
# target_include_directories(
64-
# ${COMPONENT_TARGET}
65-
# PUBLIC ${includes_public}
66-
# PRIVATE ${includes_private})
64+
65+
idf_component_register(
66+
INCLUDE_DIRS ${includes_public}
67+
PRIV_INCLUDE_DIRS ${includes_private}
68+
SRCS ${srcs}
69+
REQUIRES ${requires}
70+
PRIV_REQUIRES ${priv_requires}
71+
)
6772
target_compile_options(${COMPONENT_TARGET} PRIVATE ${compile_options})
68-
#target_link_libraries(${COMPONENT_TARGET} INTERFACE ${COMPONENT_TARGET})
6973

7074
else()
7175

0 commit comments

Comments
 (0)