mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #6609 from pauluap/compiler_warning_pcd_unsigned_signed
STM32 PCD negative numbers issuepull/6648/head
commit
37f36a776f
|
@ -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 */
|
||||
|
|
|
@ -145,7 +145,7 @@ HAL_StatusTypeDef HAL_PCD_Init(PCD_HandleTypeDef *hpcd)
|
|||
|
||||
// MBED: added
|
||||
if(hpcd->State == HAL_PCD_STATE_RESET)
|
||||
{
|
||||
{
|
||||
/* Allocate lock resource and initialize it */
|
||||
hpcd->Lock = HAL_UNLOCKED;
|
||||
for (i = 0; i < hpcd->Init.dev_endpoints ; i++)
|
||||
|
@ -1300,7 +1300,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
|
|||
{
|
||||
USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
|
||||
USB_OTG_EPTypeDef *ep;
|
||||
int32_t len = 0;
|
||||
uint32_t len;
|
||||
uint32_t len32b;
|
||||
uint32_t fifoemptymsk = 0;
|
||||
|
||||
|
@ -1334,7 +1334,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;
|
||||
atomic_clr_u32(&USBx_DEVICE->DIEPEMPMSK, fifoemptymsk); // MBED: changed
|
||||
|
|
|
@ -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