Skip to content

Commit 1657dfa

Browse files
committed
[USB] Fix EP0 MPS definition after HAL update
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 4b8fdb0 commit 1657dfa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cores/arduino/stm32/usb/usbd_conf.c

+8
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,15 @@ USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev)
465465
USBD_reenumerate();
466466
/* Set common LL Driver parameters */
467467
g_hpcd.Init.dev_endpoints = DEV_NUM_EP;
468+
#ifdef DEP0CTL_MPS_64
468469
g_hpcd.Init.ep0_mps = DEP0CTL_MPS_64;
470+
#else
471+
#ifdef EP_MPS_64
472+
g_hpcd.Init.ep0_mps = EP_MPS_64;
473+
#else
474+
#error "Missing EP0 MPS definition: DEP0CTL_MPS_64 or EP_MPS_64!"
475+
#endif
476+
#endif
469477
#if !defined(STM32F1xx) && !defined(STM32F2xx) || defined(USB)
470478
g_hpcd.Init.lpm_enable = DISABLE;
471479
g_hpcd.Init.battery_charging_enable = DISABLE;

0 commit comments

Comments
 (0)