diff options
| author | hathach <[email protected]> | 2021-05-31 18:15:47 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2021-05-31 18:15:47 +0700 |
| commit | 4e98ce914774390adcdbe9e2a299f6d47852cd07 (patch) | |
| tree | d5b3e0965d1ade7a3e43a8fadfd71fc415861005 /src/portable | |
| parent | da8000d42d6d6252eef9627efb6cf2557dfcf1d2 (diff) | |
use hcd_frame_number() instead of uframe
Diffstat (limited to 'src/portable')
| -rw-r--r-- | src/portable/ehci/ehci.c | 5 | ||||
| -rw-r--r-- | src/portable/raspberrypi/rp2040/hcd_rp2040.c | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/portable/ehci/ehci.c b/src/portable/ehci/ehci.c index 1462d0c6a..bcba360bb 100644 --- a/src/portable/ehci/ehci.c +++ b/src/portable/ehci/ehci.c @@ -65,7 +65,6 @@ typedef struct volatile uint32_t uframe_number; }ehci_data_t; - //--------------------------------------------------------------------+ // INTERNAL OBJECT & FUNCTION DECLARATION //--------------------------------------------------------------------+ @@ -125,10 +124,10 @@ static inline ehci_link_t* list_next (ehci_link_t *p_link_pointer); // HCD API //--------------------------------------------------------------------+ -uint32_t hcd_uframe_number(uint8_t rhport) +uint32_t hcd_frame_number(uint8_t rhport) { (void) rhport; - return ehci_data.uframe_number + ehci_data.regs->frame_index; + return (ehci_data.uframe_number + ehci_data.regs->frame_index) >> 3; } void hcd_port_reset(uint8_t rhport) diff --git a/src/portable/raspberrypi/rp2040/hcd_rp2040.c b/src/portable/raspberrypi/rp2040/hcd_rp2040.c index b8833fbec..864c6253e 100644 --- a/src/portable/raspberrypi/rp2040/hcd_rp2040.c +++ b/src/portable/raspberrypi/rp2040/hcd_rp2040.c @@ -504,10 +504,9 @@ bool hcd_setup_send(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet return true; } -uint32_t hcd_uframe_number(uint8_t rhport) +uint32_t hcd_frame_number(uint8_t rhport) { - // Microframe number is (125us) but we are max full speed so return miliseconds * 8 - return usb_hw->sof_rd * 8; + return usb_hw->sof_rd; } bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const * ep_desc) |
