Skip to content

Commit 07b6f0f

Browse files
vbrzeskitmon-nordic
authored andcommitted
[nrf fromtree] include: usb_ch9: fix USB_FS_ISO_EP_INTERVAL calculation
Per section 5.6.4 of the USB 2.0 standard, Isochronous Endpoints are derived by the (2^(bInterval-1) * F) formula. The current implementation uses the formula intended for Interrupt Endpoints. Signed-off-by: Victor Brzeski <[email protected]> (cherry picked from commit d9c7b19) Signed-off-by: Tomasz Moń <[email protected]>
1 parent 89f3c4e commit 07b6f0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/zephyr/usb/usb_ch9.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ struct usb_association_descriptor {
354354
/** Calculate high speed interrupt endpoint bInterval from a value in microseconds */
355355
#define USB_HS_INT_EP_INTERVAL(us) CLAMP((ilog2((us) / 125U) + 1U), 1U, 16U)
356356

357-
/** Calculate high speed isochronous endpoint bInterval from a value in microseconds */
358-
#define USB_FS_ISO_EP_INTERVAL(us) CLAMP(((us) / 1000U), 1U, 16U)
357+
/** Calculate full speed isochronous endpoint bInterval from a value in microseconds */
358+
#define USB_FS_ISO_EP_INTERVAL(us) CLAMP((ilog2((us) / 1000U) + 1U), 1U, 16U)
359359

360360
/** Calculate high speed isochronous endpoint bInterval from a value in microseconds */
361361
#define USB_HS_ISO_EP_INTERVAL(us) CLAMP((ilog2((us) / 125U) + 1U), 1U, 16U)

0 commit comments

Comments
 (0)