File tree 7 files changed +2
-30
lines changed 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 \
103
103
-Wl,--print-memory-usage \
104
104
-Wl,--no-warn-rwx-segment
105
105
106
- ifeq ($(MCU_CORE ) ,M55_HP)
107
- CFLAGS += -Wl,--wrap=dcd_event_handler
108
- endif
109
-
110
106
# ###############################################################################
111
107
# Source files and libraries
112
108
Original file line number Diff line number Diff line change @@ -97,10 +97,6 @@ if(MICROPY_PY_TINYUSB)
97
97
list (APPEND MICROPY_INC_TINYUSB
98
98
${MICROPY_DIR} /shared/tinyusb/
99
99
)
100
-
101
- list (APPEND MICROPY_LINK_TINYUSB
102
- -Wl,--wrap=dcd_event_handler
103
- )
104
100
endif ()
105
101
106
102
list (APPEND MICROPY_SOURCE_PORT
@@ -261,10 +257,6 @@ target_compile_options(${MICROPY_TARGET} PUBLIC
261
257
-Wno-missing-field-initializers
262
258
)
263
259
264
- target_link_options (${MICROPY_TARGET} PUBLIC
265
- ${MICROPY_LINK_TINYUSB}
266
- )
267
-
268
260
# Additional include directories needed for private NimBLE headers.
269
261
target_include_directories (${MICROPY_TARGET} PUBLIC
270
262
${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/,\
268
268
portable/nordic/nrf5x/dcd_nrf5x.c \
269
269
)
270
270
271
- LDFLAGS += -Wl,--wrap=dcd_event_handler
272
271
endif
273
272
274
273
DRIVERS_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)"
157
157
LDFLAGS += -L"$(shell dirname $(LIBSTDCPP_FILE_NAME ) ) "
158
158
endif
159
159
160
- # Hook tinyusb USB interrupt if used to service usb task.
161
- LDFLAGS += --wrap=dcd_event_handler
162
-
163
160
# Options for mpy-cross
164
161
MPY_CROSS_FLAGS += -march=armv7m
165
162
Original file line number Diff line number Diff line change @@ -525,7 +525,6 @@ target_compile_options(${MICROPY_TARGET} PRIVATE
525
525
526
526
target_link_options (${MICROPY_TARGET} PRIVATE
527
527
-Wl,--defsym=__micropy_c_heap_size__=${MICROPY_C_HEAP_SIZE}
528
- -Wl,--wrap=dcd_event_handler
529
528
-Wl,--wrap=runtime_init_clocks
530
529
)
531
530
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)"
113
113
LDFLAGS += -L"$(shell dirname $(LIBSTDCPP_FILE_NAME ) ) "
114
114
endif
115
115
116
- LDFLAGS += --wrap=dcd_event_handler
117
-
118
116
MPY_CROSS_FLAGS += -march=$(MPY_CROSS_MCU_ARCH )
119
117
120
118
SRC_C += \
Original file line number Diff line number Diff line change 30
30
31
31
#include "mp_usbd.h"
32
32
33
- #ifndef NO_QSTR
34
- #include "device/dcd.h"
35
- #endif
36
-
37
33
#if !MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE
38
34
39
35
void mp_usbd_task (void ) {
@@ -47,13 +43,8 @@ void mp_usbd_task_callback(mp_sched_node_t *node) {
47
43
48
44
#endif // !MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE
49
45
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 ) {
57
48
mp_usbd_schedule_task ();
58
49
mp_hal_wake_main_task_from_isr ();
59
50
}
You can’t perform that action at this time.
0 commit comments