merge iso and cbi transaction size to max ep size
This commit is contained in:
parent
44916bcacf
commit
43ca626774
|
@ -153,15 +153,7 @@ void _hw_endpoint_xfer_start(struct hw_endpoint *ep, uint8_t *buffer, uint16_t t
|
||||||
// Fill in info now that we're kicking off the hw
|
// Fill in info now that we're kicking off the hw
|
||||||
ep->total_len = total_len;
|
ep->total_len = total_len;
|
||||||
ep->len = 0;
|
ep->len = 0;
|
||||||
// FIXME: What if low speed
|
|
||||||
if(ep->transfer_type == TUSB_XFER_ISOCHRONOUS)
|
|
||||||
{
|
|
||||||
ep->transfer_size = tu_min32(total_len, ep->wMaxPacketSize);
|
ep->transfer_size = tu_min32(total_len, ep->wMaxPacketSize);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ep->transfer_size = tu_min32(total_len, 64);
|
|
||||||
}
|
|
||||||
ep->active = true;
|
ep->active = true;
|
||||||
ep->user_buf = buffer;
|
ep->user_buf = buffer;
|
||||||
// Recalculate if this is the last buffer
|
// Recalculate if this is the last buffer
|
||||||
|
@ -239,15 +231,7 @@ bool _hw_endpoint_xfer_continue(struct hw_endpoint *ep)
|
||||||
|
|
||||||
// Now we have synced our state with the hardware. Is there more data to transfer?
|
// Now we have synced our state with the hardware. Is there more data to transfer?
|
||||||
uint remaining_bytes = ep->total_len - ep->len;
|
uint remaining_bytes = ep->total_len - ep->len;
|
||||||
|
|
||||||
if(ep->transfer_type == TUSB_XFER_ISOCHRONOUS)
|
|
||||||
{
|
|
||||||
ep->transfer_size = tu_min32(remaining_bytes, ep->wMaxPacketSize);
|
ep->transfer_size = tu_min32(remaining_bytes, ep->wMaxPacketSize);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ep->transfer_size = tu_min32(remaining_bytes, 64);
|
|
||||||
}
|
|
||||||
_hw_endpoint_update_last_buf(ep);
|
_hw_endpoint_update_last_buf(ep);
|
||||||
|
|
||||||
// Can happen because of programmer error so check for it
|
// Can happen because of programmer error so check for it
|
||||||
|
|
Loading…
Reference in New Issue