summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/rp2/CMakeLists.txt2
-rw-r--r--ports/rp2/main.c4
-rw-r--r--ports/rp2/mpconfigport.h4
3 files changed, 10 insertions, 0 deletions
diff --git a/ports/rp2/CMakeLists.txt b/ports/rp2/CMakeLists.txt
index 392fed29b..b605faaf2 100644
--- a/ports/rp2/CMakeLists.txt
+++ b/ports/rp2/CMakeLists.txt
@@ -108,6 +108,7 @@ set(MICROPY_SOURCE_LIB
${MICROPY_DIR}/shared/tinyusb/mp_cdc_common.c
${MICROPY_DIR}/shared/tinyusb/mp_usbd.c
${MICROPY_DIR}/shared/tinyusb/mp_usbd_descriptor.c
+ ${MICROPY_DIR}/shared/tinyusb/mp_usbd_runtime.c
)
set(MICROPY_SOURCE_DRIVERS
@@ -146,6 +147,7 @@ set(MICROPY_SOURCE_QSTR
${MICROPY_DIR}/shared/readline/readline.c
${MICROPY_DIR}/shared/runtime/mpirq.c
${MICROPY_DIR}/shared/runtime/sys_stdio_mphal.c
+ ${MICROPY_DIR}/shared/tinyusb/mp_usbd_runtime.c
${MICROPY_PORT_DIR}/machine_adc.c
${MICROPY_PORT_DIR}/machine_i2c.c
${MICROPY_PORT_DIR}/machine_pin.c
diff --git a/ports/rp2/main.c b/ports/rp2/main.c
index 70a67066f..40374faff 100644
--- a/ports/rp2/main.c
+++ b/ports/rp2/main.c
@@ -221,6 +221,10 @@ int main(int argc, char **argv) {
mp_thread_deinit();
#endif
soft_timer_deinit();
+ #if MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE
+ mp_usbd_deinit();
+ #endif
+
gc_sweep_all();
mp_deinit();
}
diff --git a/ports/rp2/mpconfigport.h b/ports/rp2/mpconfigport.h
index c11d2fa69..a29692d0b 100644
--- a/ports/rp2/mpconfigport.h
+++ b/ports/rp2/mpconfigport.h
@@ -52,6 +52,10 @@
#ifndef MICROPY_HW_USB_MSC
#define MICROPY_HW_USB_MSC (0)
#endif
+
+#ifndef MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE
+#define MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE (1) // Support machine.USBDevice
+#endif
#endif
#ifndef MICROPY_CONFIG_ROM_LEVEL