white space

This commit is contained in:
hathach 2021-08-12 00:12:15 +07:00
parent 88d4cb402d
commit 4f2999bc04
No known key found for this signature in database
GPG Key ID: 2FA891220FBFD581
1 changed files with 48 additions and 48 deletions

View File

@ -70,13 +70,13 @@ static struct hw_endpoint *hw_endpoint_get_by_addr(uint8_t ep_addr)
return hw_endpoint_get_by_num(num, dir);
}
static void _hw_endpoint_alloc(struct hw_endpoint *ep)
static void _hw_endpoint_alloc(struct hw_endpoint *ep, uint8_t transfer_type)
{
// size must be multiple of 64
uint16_t size = tu_div_ceil(ep->wMaxPacketSize, 64) * 64u;
// double buffered for Control and Bulk endpoint
if ( ep->transfer_type == TUSB_XFER_CONTROL || ep->transfer_type == TUSB_XFER_BULK)
if ( transfer_type == TUSB_XFER_CONTROL || transfer_type == TUSB_XFER_BULK )
{
size *= 2u;
}
@ -96,7 +96,7 @@ static void _hw_endpoint_alloc(struct hw_endpoint *ep)
ep_dir_string[tu_edpt_dir(ep->ep_addr)]);
// Fill in endpoint control register with buffer offset
uint32_t const reg = EP_CTRL_ENABLE_BITS | (ep->transfer_type << EP_CTRL_BUFFER_TYPE_LSB) | dpram_offset;
uint32_t const reg = EP_CTRL_ENABLE_BITS | (transfer_type << EP_CTRL_BUFFER_TYPE_LSB) | dpram_offset;
*ep->endpoint_control = reg;
}
@ -177,7 +177,7 @@ static void hw_endpoint_init(uint8_t ep_addr, uint16_t wMaxPacketSize, uint8_t t
// TODO device may change configuration (dynamic), should clear and reallocate
if ( !(ep->configured) )
{
_hw_endpoint_alloc(ep);
_hw_endpoint_alloc(ep, transfer_type);
}
}