rp2: Enable support for Python USB devices.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
pull/9497/head
Angus Gratton 2024-03-13 10:38:05 +11:00 zatwierdzone przez Damien George
rodzic 9d0d262be0
commit 0baa3b5528
3 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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();
}

Wyświetl plik

@ -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