mirror of https://github.com/ARMmbed/mbed-os.git
Extend changes to other STM32 devices that have the PCD_WriteEmptyTxFifo() function
parent
b45d4233e1
commit
20f11bc13f
|
@ -1152,7 +1152,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
|
|||
{
|
||||
USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
|
||||
USB_OTG_EPTypeDef *ep = NULL;
|
||||
int32_t len = 0;
|
||||
uint32_t len;
|
||||
uint32_t len32b = 0U;
|
||||
uint32_t fifoemptymsk = 0U;
|
||||
|
||||
|
@ -1185,7 +1185,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
|
|||
ep->xfer_count += len;
|
||||
}
|
||||
|
||||
if(len <= 0)
|
||||
if (ep->xfer_count >= ep->xfer_len)
|
||||
{
|
||||
fifoemptymsk = 0x01U << epnum;
|
||||
USBx_DEVICE->DIEPEMPMSK &= ~fifoemptymsk;
|
||||
|
|
|
@ -1213,7 +1213,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
|
|||
{
|
||||
USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
|
||||
USB_OTG_EPTypeDef *ep;
|
||||
int32_t len = 0U;
|
||||
uint32_t len;
|
||||
uint32_t len32b;
|
||||
uint32_t fifoemptymsk = 0U;
|
||||
|
||||
|
@ -1247,7 +1247,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
|
|||
ep->xfer_count += len;
|
||||
}
|
||||
|
||||
if(len <= 0U)
|
||||
if (ep->xfer_count >= ep->xfer_len)
|
||||
{
|
||||
fifoemptymsk = 0x1U << epnum;
|
||||
atomic_clr_u32(&USBx_DEVICE->DIEPEMPMSK, fifoemptymsk);
|
||||
|
|
|
@ -1311,7 +1311,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
|
|||
{
|
||||
USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
|
||||
USB_OTG_EPTypeDef *ep;
|
||||
int32_t len = 0U;
|
||||
uint32_t len;
|
||||
uint32_t len32b;
|
||||
uint32_t fifoemptymsk = 0U;
|
||||
|
||||
|
@ -1345,7 +1345,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
|
|||
ep->xfer_count += len;
|
||||
}
|
||||
|
||||
if(len <= 0U)
|
||||
if (ep->xfer_count >= ep->xfer_len)
|
||||
{
|
||||
fifoemptymsk = 0x1U << epnum;
|
||||
/* MBED */
|
||||
|
|
|
@ -1428,7 +1428,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
|
|||
{
|
||||
USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
|
||||
USB_OTG_EPTypeDef *ep = NULL;
|
||||
int32_t len = 0U;
|
||||
uint32_t len;
|
||||
uint32_t len32b = 0;
|
||||
uint32_t fifoemptymsk = 0;
|
||||
|
||||
|
@ -1462,7 +1462,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
|
|||
ep->xfer_count += len;
|
||||
}
|
||||
|
||||
if(len <= 0)
|
||||
if (ep->xfer_count >= ep->xfer_len)
|
||||
{
|
||||
fifoemptymsk = 0x1 << epnum;
|
||||
// Added for MBED PR #3062
|
||||
|
|
Loading…
Reference in New Issue