kopia lustrzana https://github.com/micropython/micropython
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
rodzic
9d0d262be0
commit
0baa3b5528
|
@ -108,6 +108,7 @@ set(MICROPY_SOURCE_LIB
|
||||||
${MICROPY_DIR}/shared/tinyusb/mp_cdc_common.c
|
${MICROPY_DIR}/shared/tinyusb/mp_cdc_common.c
|
||||||
${MICROPY_DIR}/shared/tinyusb/mp_usbd.c
|
${MICROPY_DIR}/shared/tinyusb/mp_usbd.c
|
||||||
${MICROPY_DIR}/shared/tinyusb/mp_usbd_descriptor.c
|
${MICROPY_DIR}/shared/tinyusb/mp_usbd_descriptor.c
|
||||||
|
${MICROPY_DIR}/shared/tinyusb/mp_usbd_runtime.c
|
||||||
)
|
)
|
||||||
|
|
||||||
set(MICROPY_SOURCE_DRIVERS
|
set(MICROPY_SOURCE_DRIVERS
|
||||||
|
@ -146,6 +147,7 @@ set(MICROPY_SOURCE_QSTR
|
||||||
${MICROPY_DIR}/shared/readline/readline.c
|
${MICROPY_DIR}/shared/readline/readline.c
|
||||||
${MICROPY_DIR}/shared/runtime/mpirq.c
|
${MICROPY_DIR}/shared/runtime/mpirq.c
|
||||||
${MICROPY_DIR}/shared/runtime/sys_stdio_mphal.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_adc.c
|
||||||
${MICROPY_PORT_DIR}/machine_i2c.c
|
${MICROPY_PORT_DIR}/machine_i2c.c
|
||||||
${MICROPY_PORT_DIR}/machine_pin.c
|
${MICROPY_PORT_DIR}/machine_pin.c
|
||||||
|
|
|
@ -221,6 +221,10 @@ int main(int argc, char **argv) {
|
||||||
mp_thread_deinit();
|
mp_thread_deinit();
|
||||||
#endif
|
#endif
|
||||||
soft_timer_deinit();
|
soft_timer_deinit();
|
||||||
|
#if MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE
|
||||||
|
mp_usbd_deinit();
|
||||||
|
#endif
|
||||||
|
|
||||||
gc_sweep_all();
|
gc_sweep_all();
|
||||||
mp_deinit();
|
mp_deinit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,10 @@
|
||||||
#ifndef MICROPY_HW_USB_MSC
|
#ifndef MICROPY_HW_USB_MSC
|
||||||
#define MICROPY_HW_USB_MSC (0)
|
#define MICROPY_HW_USB_MSC (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE
|
||||||
|
#define MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE (1) // Support machine.USBDevice
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MICROPY_CONFIG_ROM_LEVEL
|
#ifndef MICROPY_CONFIG_ROM_LEVEL
|
||||||
|
|
Ładowanie…
Reference in New Issue