Extend changes to other STM32 devices that have the PCD_WriteEmptyTxFifo() function

pull/6609/head
Paul Thompson 2018-04-13 05:27:03 -07:00
parent b45d4233e1
commit 20f11bc13f
4 changed files with 8 additions and 8 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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 */

View File

@ -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