Skip to content

Commit 722590c

Browse files
committed
ports/esp32: Use shared/tinyusb integration.
Uses newer libusb synopsys/dwc2 driver rather than the IDF tinyusb component. Signed-off-by: Andrew Leech <andrew@alelec.net>
1 parent 457e02a commit 722590c

File tree

1 file changed

+35
-28
lines changed

1 file changed

+35
-28
lines changed

ports/esp32/esp32_common.cmake

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -52,34 +52,6 @@ list(APPEND MICROPY_SOURCE_DRIVERS
5252
${MICROPY_DIR}/drivers/dht/dht.c
5353
)
5454

55-
if(MICROPY_PY_TINYUSB)
56-
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/tinyusb)
57-
58-
set(TINYUSB_SRC "${MICROPY_DIR}/lib/tinyusb/src")
59-
string(TOUPPER OPT_MCU_${IDF_TARGET} tusb_mcu)
60-
61-
list(APPEND MICROPY_DEF_CORE
62-
CFG_TUSB_MCU=${tusb_mcu}
63-
)
64-
65-
list(APPEND MICROPY_SOURCE_LIB
66-
${TINYUSB_SRC}/tusb.c
67-
${TINYUSB_SRC}/common/tusb_fifo.c
68-
${TINYUSB_SRC}/device/usbd.c
69-
${TINYUSB_SRC}/device/usbd_control.c
70-
${TINYUSB_SRC}/class/cdc/cdc_device.c
71-
${TINYUSB_SRC}/portable/synopsys/dwc2/dcd_dwc2.c
72-
${MICROPY_DIR}/shared/tinyusb/mp_usbd.c
73-
${MICROPY_DIR}/shared/tinyusb/mp_usbd_cdc.c
74-
${MICROPY_DIR}/shared/tinyusb/mp_usbd_descriptor.c
75-
)
76-
77-
list(APPEND MICROPY_INC_CORE
78-
${TINYUSB_SRC}
79-
${MICROPY_DIR}/shared/tinyusb/
80-
)
81-
endif()
82-
8355
list(APPEND MICROPY_SOURCE_PORT
8456
panichandler.c
8557
adc.c
@@ -220,6 +192,41 @@ target_include_directories(${MICROPY_TARGET} PUBLIC
220192
${IDF_PATH}/components/bt/host/nimble/nimble
221193
)
222194

195+
if(MICROPY_PY_TINYUSB)
196+
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/tinyusb)
197+
198+
# if(ECHO_SUBMODULES)
199+
# # No-op, we're just doing submodule/variant discovery.
200+
# # Cannot run the add_library/target_include_directories rules (even though
201+
# # the build won't run) because IDF will attempt verify the files exist.
202+
# else()
203+
204+
set(TINYUSB_SRC "${MICROPY_DIR}/lib/tinyusb/src")
205+
string(TOUPPER OPT_MCU_${IDF_TARGET} tusb_mcu)
206+
207+
list(APPEND MICROPY_DEF_CORE
208+
CFG_TUSB_MCU=${tusb_mcu}
209+
)
210+
211+
list(APPEND MICROPY_SOURCE_LIB
212+
${TINYUSB_SRC}/tusb.c
213+
${TINYUSB_SRC}/common/tusb_fifo.c
214+
${TINYUSB_SRC}/device/usbd.c
215+
${TINYUSB_SRC}/device/usbd_control.c
216+
${TINYUSB_SRC}/class/cdc/cdc_device.c
217+
${TINYUSB_SRC}/portable/synopsys/dwc2/dcd_dwc2.c
218+
${MICROPY_DIR}/shared/tinyusb/mp_usbd.c
219+
${MICROPY_DIR}/shared/tinyusb/mp_usbd_cdc.c
220+
${MICROPY_DIR}/shared/tinyusb/mp_usbd_descriptor.c
221+
)
222+
223+
target_include_directories(${MICROPY_TARGET} PRIVATE
224+
${TINYUSB_SRC}
225+
${MICROPY_DIR}/shared/tinyusb/
226+
)
227+
# endif()
228+
endif()
229+
223230
# Add additional extmod and usermod components.
224231
target_link_libraries(${MICROPY_TARGET} micropy_extmod_btree)
225232
target_link_libraries(${MICROPY_TARGET} usermod)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy