diff --git a/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c b/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c index b1a60ae2be..d04117f8d1 100644 --- a/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c +++ b/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c @@ -393,12 +393,14 @@ USBD_StatusTypeDef USBD_LL_DataInStage(USBD_HandleTypeDef *pdev, } else { - if ((pdev->pClass->EP0_TxSent != NULL) && - (pdev->dev_state == USBD_STATE_CONFIGURED)) + if (pdev->dev_state == USBD_STATE_CONFIGURED) { - pdev->pClass->EP0_TxSent(pdev); + if (pdev->pClass->EP0_TxSent != NULL) + { + pdev->pClass->EP0_TxSent(pdev); + } + USBD_LL_StallEP(pdev, 0x80U); } - USBD_LL_StallEP(pdev, 0x80U); USBD_CtlReceiveStatus(pdev); } }