File tree Expand file tree Collapse file tree 7 files changed +2
-30
lines changed Expand file tree Collapse file tree 7 files changed +2
-30
lines changed Original file line number Diff line number Diff line change @@ -103,10 +103,6 @@ CFLAGS += -Wl,-T$(BUILD)/ensemble.ld \
103103 -Wl,--print-memory-usage \
104104 -Wl,--no-warn-rwx-segment
105105
106- ifeq ($(MCU_CORE ) ,M55_HP)
107- CFLAGS += -Wl,--wrap=dcd_event_handler
108- endif
109-
110106# ###############################################################################
111107# Source files and libraries
112108
Original file line number Diff line number Diff line change @@ -97,10 +97,6 @@ if(MICROPY_PY_TINYUSB)
9797 list (APPEND MICROPY_INC_TINYUSB
9898 ${MICROPY_DIR} /shared/tinyusb/
9999 )
100-
101- list (APPEND MICROPY_LINK_TINYUSB
102- -Wl,--wrap=dcd_event_handler
103- )
104100endif ()
105101
106102list (APPEND MICROPY_SOURCE_PORT
@@ -261,10 +257,6 @@ target_compile_options(${MICROPY_TARGET} PUBLIC
261257 -Wno-missing-field-initializers
262258)
263259
264- target_link_options (${MICROPY_TARGET} PUBLIC
265- ${MICROPY_LINK_TINYUSB}
266- )
267-
268260# Additional include directories needed for private NimBLE headers.
269261target_include_directories (${MICROPY_TARGET} PUBLIC
270262 ${IDF_PATH} /components/bt/host/nimble/nimble
Original file line number Diff line number Diff line change @@ -268,7 +268,6 @@ SRC_C += $(addprefix lib/tinyusb/src/,\
268268 portable/nordic/nrf5x/dcd_nrf5x.c \
269269 )
270270
271- LDFLAGS += -Wl,--wrap=dcd_event_handler
272271endif
273272
274273DRIVERS_SRC_C += $(addprefix modules/,\
Original file line number Diff line number Diff line change @@ -157,9 +157,6 @@ LIBSTDCPP_FILE_NAME = "$(shell $(CXX) $(CXXFLAGS) -print-file-name=libstdc++.a)"
157157LDFLAGS += -L"$(shell dirname $(LIBSTDCPP_FILE_NAME ) ) "
158158endif
159159
160- # Hook tinyusb USB interrupt if used to service usb task.
161- LDFLAGS += --wrap=dcd_event_handler
162-
163160# Options for mpy-cross
164161MPY_CROSS_FLAGS += -march=armv7m
165162
Original file line number Diff line number Diff line change @@ -525,7 +525,6 @@ target_compile_options(${MICROPY_TARGET} PRIVATE
525525
526526target_link_options (${MICROPY_TARGET} PRIVATE
527527 -Wl,--defsym=__micropy_c_heap_size__=${MICROPY_C_HEAP_SIZE}
528- -Wl,--wrap=dcd_event_handler
529528 -Wl,--wrap=runtime_init_clocks
530529)
531530
Original file line number Diff line number Diff line change @@ -113,8 +113,6 @@ LIBSTDCPP_FILE_NAME = "$(shell $(CXX) $(CXXFLAGS) -print-file-name=libstdc++.a)"
113113LDFLAGS += -L"$(shell dirname $(LIBSTDCPP_FILE_NAME ) ) "
114114endif
115115
116- LDFLAGS += --wrap=dcd_event_handler
117-
118116MPY_CROSS_FLAGS += -march=$(MPY_CROSS_MCU_ARCH )
119117
120118SRC_C += \
Original file line number Diff line number Diff line change 3030
3131#include "mp_usbd.h"
3232
33- #ifndef NO_QSTR
34- #include "device/dcd.h"
35- #endif
36-
3733#if !MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE
3834
3935void mp_usbd_task (void ) {
@@ -47,13 +43,8 @@ void mp_usbd_task_callback(mp_sched_node_t *node) {
4743
4844#endif // !MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE
4945
50- extern void __real_dcd_event_handler (dcd_event_t const * event , bool in_isr );
51-
52- // If -Wl,--wrap=dcd_event_handler is passed to the linker, then this wrapper
53- // will be called and allows MicroPython to schedule the TinyUSB task when
54- // dcd_event_handler() is called from an ISR.
55- TU_ATTR_FAST_FUNC void __wrap_dcd_event_handler (dcd_event_t const * event , bool in_isr ) {
56- __real_dcd_event_handler (event , in_isr );
46+ // Schedule the TinyUSB task on demand, when there is a new USB device event
47+ TU_ATTR_FAST_FUNC void tud_event_hook_cb (uint8_t rhport , uint32_t eventid , bool in_isr ) {
5748 mp_usbd_schedule_task ();
5849 mp_hal_wake_main_task_from_isr ();
5950}
You can’t perform that action at this time.
0 commit comments