mirror of https://github.com/ARMmbed/mbed-os.git
Make the atomic_clr_u32 conditional use raw values rather than computed, remove need for guards
parent
2211a27f53
commit
b45d4233e1
|
@ -1307,7 +1307,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
|
||||||
ep = &hpcd->IN_ep[epnum];
|
ep = &hpcd->IN_ep[epnum];
|
||||||
len = ep->xfer_len - ep->xfer_count;
|
len = ep->xfer_len - ep->xfer_count;
|
||||||
|
|
||||||
if (((int32_t)len > 0) && (len > ep->maxpacket))
|
if (len > ep->maxpacket)
|
||||||
{
|
{
|
||||||
len = ep->maxpacket;
|
len = ep->maxpacket;
|
||||||
}
|
}
|
||||||
|
@ -1322,7 +1322,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
|
||||||
/* Write the FIFO */
|
/* Write the FIFO */
|
||||||
len = ep->xfer_len - ep->xfer_count;
|
len = ep->xfer_len - ep->xfer_count;
|
||||||
|
|
||||||
if (((int32_t)len > 0) && (len > ep->maxpacket))
|
if (len > ep->maxpacket)
|
||||||
{
|
{
|
||||||
len = ep->maxpacket;
|
len = ep->maxpacket;
|
||||||
}
|
}
|
||||||
|
@ -1334,7 +1334,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
|
||||||
ep->xfer_count += len;
|
ep->xfer_count += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((int32_t)len <= 0)
|
if (ep->xfer_count >= ep->xfer_len)
|
||||||
{
|
{
|
||||||
fifoemptymsk = 0x1 << epnum;
|
fifoemptymsk = 0x1 << epnum;
|
||||||
atomic_clr_u32(&USBx_DEVICE->DIEPEMPMSK, fifoemptymsk); // MBED: changed
|
atomic_clr_u32(&USBx_DEVICE->DIEPEMPMSK, fifoemptymsk); // MBED: changed
|
||||||
|
|
Loading…
Reference in New Issue