From d7d7e61f3437076a38ec031f2dc4cef38c8c831b Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 3 Apr 2022 22:48:08 +0700 Subject: [PATCH] correct pio usb speed, and close device --- lib/Pico-PIO-USB | 2 +- src/portable/raspberrypi/pio_usb/hcd_pio_usb.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Pico-PIO-USB b/lib/Pico-PIO-USB index b507f95de..650ef75f0 160000 --- a/lib/Pico-PIO-USB +++ b/lib/Pico-PIO-USB @@ -1 +1 @@ -Subproject commit b507f95de457d5dc14fb15fd6481ef748c6e3342 +Subproject commit 650ef75f0d8a4020a7ddc2ccee1ee0f3237ab760 diff --git a/src/portable/raspberrypi/pio_usb/hcd_pio_usb.c b/src/portable/raspberrypi/pio_usb/hcd_pio_usb.c index c2ac2c706..839087957 100644 --- a/src/portable/raspberrypi/pio_usb/hcd_pio_usb.c +++ b/src/portable/raspberrypi/pio_usb/hcd_pio_usb.c @@ -81,12 +81,15 @@ bool hcd_port_connect_status(uint8_t rhport) tusb_speed_t hcd_port_speed_get(uint8_t rhport) { // TODO determine link speed - return TUSB_SPEED_FULL; + rhport = RHPORT_PIO(rhport); + return PIO_USB_HW_RPORT(rhport)->is_fullspeed ? TUSB_SPEED_FULL : TUSB_SPEED_LOW; } // Close all opened endpoint belong to this device void hcd_device_close(uint8_t rhport, uint8_t dev_addr) { + rhport = RHPORT_PIO(rhport); + pio_usb_host_close_device(rhport, dev_addr); } uint32_t hcd_frame_number(uint8_t rhport)