Make the atomic_clr_u32 conditional use raw values rather than computed, remove need for guards

pull/6609/head
Paul Thompson 2018-04-13 04:44:43 -07:00
parent 2211a27f53
commit b45d4233e1
1 changed files with 3 additions and 3 deletions

View File

@ -1307,7 +1307,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
ep = &hpcd->IN_ep[epnum];
len = ep->xfer_len - ep->xfer_count;
if (((int32_t)len > 0) && (len > ep->maxpacket))
if (len > ep->maxpacket)
{
len = ep->maxpacket;
}
@ -1322,7 +1322,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
/* Write the FIFO */
len = ep->xfer_len - ep->xfer_count;
if (((int32_t)len > 0) && (len > ep->maxpacket))
if (len > ep->maxpacket)
{
len = ep->maxpacket;
}
@ -1334,7 +1334,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
ep->xfer_count += len;
}
if ((int32_t)len <= 0)
if (ep->xfer_count >= ep->xfer_len)
{
fifoemptymsk = 0x1 << epnum;
atomic_clr_u32(&USBx_DEVICE->DIEPEMPMSK, fifoemptymsk); // MBED: changed