static struct stm32_usb *usb = (struct stm32_usb *)USB_BASE_ADDR;
/* Endpoint descriptors: used for handling requests to use with endpoints */
-static stm32_UsbEp ep_cnfg[ENP_MAX_NUMB];
+static stm32_UsbEp ep_cnfg[EP_MAX_NUM];
/* USB EP0 control descriptor */
static const UsbEndpointDesc USB_CtrlEpDescr0 =
static stm32_UsbMemSlot *mem_use;
/* USB packet memory management: memory buffer metadata */
-#define EP_MAX_SLOTS 16
-static stm32_UsbMemSlot memory_buffer[EP_MAX_SLOTS];
+static stm32_UsbMemSlot memory_buffer[EP_MAX_HW_NUM >> 1];
/* Endpoint TX and RX buffers */
/// \cond
static stm32_UsbIoStatus
__usb_ep_read(int ep, void *buffer, ssize_t size, void (*complete)(int))
{
- if (UNLIKELY((ep >= ENP_MAX_NUMB) || (ep & 0x01)))
+ if (UNLIKELY((ep >= EP_MAX_NUM) || (ep & 0x01)))
{
LOG_ERR("%s: invalid EP number %d\n", __func__, ep);
ASSERT(0);
static stm32_UsbIoStatus
__usb_ep_write(int ep, const void *buffer, ssize_t size, void (*complete)(int))
{
- if (UNLIKELY((ep >= ENP_MAX_NUMB) || !(ep & 0x01)))
+ if (UNLIKELY((ep >= EP_MAX_NUM) || !(ep & 0x01)))
{
LOG_ERR("%s: invalid EP number %d\n", __func__, ep);
ASSERT(0);
static void usb_endpointRead_complete(int ep)
{
- if (UNLIKELY(ep >= ENP_MAX_NUMB))
+ if (UNLIKELY(ep >= EP_MAX_NUM))
{
ASSERT(0);
return;
static void usb_endpointWrite_complete(int ep)
{
- if (UNLIKELY(ep >= ENP_MAX_NUMB))
+ if (UNLIKELY(ep >= EP_MAX_NUM))
{
ASSERT(0);
return;