sekigon-gonnoc / Pico-PIO-USB

USB host/device implementation using PIO of raspberry pi pico (RP2040).
MIT License
1.32k stars 137 forks source link

add pio_usb_host_get_frame_number() #88

Closed hathach closed 1 year ago

hathach commented 1 year ago

This PR add pio_usb_host_get_frame_number() which can be handy for tinyusb when doing delay without actually using any hw timer https://github.com/hathach/tinyusb/blob/master/src/host/usbh.c#L261

which I kind of forgot to add so far https://github.com/hathach/tinyusb/blob/master/src/portable/raspberrypi/pio_usb/hcd_pio_usb.c#L105

This also increase sof_count to 11-bit in SOF packet (previously 5-bit).

modification is originially written by @tannewt

screenshort with frame number wrap-around Screenshot from 2023-06-29 10-29-56

sekigon-gonnoc commented 1 year ago

thanks!