/* Set the receive buffer size for a given USB endpoint. */
uint16_t st_usbfs_set_ep_rx_bufsize(usbd_device *dev, uint8_t ep, uint32_t size)
/* Set the receive buffer size for a given USB endpoint. */
uint16_t st_usbfs_set_ep_rx_bufsize(usbd_device *dev, uint8_t ep, uint32_t size)
{
	uint16_t realsize;
	(void)dev;
	if (size > 62) {
		size = ((size - 1) >> 5) & 0x1F;
		realsize = (size + 1) << 5;
		size |= (1<<5);
	} else {
		size = (size + 1) >> 1;
		realsize = size << 1;
	}
	USB_SET_EP_RX_COUNT(ep, size << 10);
	return realsize;
}