Skip to content

Commit 20f11bc

Browse files
author
Paul Thompson
committed
Extend changes to other STM32 devices that have the PCD_WriteEmptyTxFifo() function
1 parent b45d423 commit 20f11bc

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal_pcd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
11521152
{
11531153
USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
11541154
USB_OTG_EPTypeDef *ep = NULL;
1155-
int32_t len = 0;
1155+
uint32_t len;
11561156
uint32_t len32b = 0U;
11571157
uint32_t fifoemptymsk = 0U;
11581158

@@ -1185,7 +1185,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
11851185
ep->xfer_count += len;
11861186
}
11871187

1188-
if(len <= 0)
1188+
if (ep->xfer_count >= ep->xfer_len)
11891189
{
11901190
fifoemptymsk = 0x01U << epnum;
11911191
USBx_DEVICE->DIEPEMPMSK &= ~fifoemptymsk;

targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_pcd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
12131213
{
12141214
USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
12151215
USB_OTG_EPTypeDef *ep;
1216-
int32_t len = 0U;
1216+
uint32_t len;
12171217
uint32_t len32b;
12181218
uint32_t fifoemptymsk = 0U;
12191219

@@ -1247,7 +1247,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
12471247
ep->xfer_count += len;
12481248
}
12491249

1250-
if(len <= 0U)
1250+
if (ep->xfer_count >= ep->xfer_len)
12511251
{
12521252
fifoemptymsk = 0x1U << epnum;
12531253
atomic_clr_u32(&USBx_DEVICE->DIEPEMPMSK, fifoemptymsk);

targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_pcd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
13111311
{
13121312
USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
13131313
USB_OTG_EPTypeDef *ep;
1314-
int32_t len = 0U;
1314+
uint32_t len;
13151315
uint32_t len32b;
13161316
uint32_t fifoemptymsk = 0U;
13171317

@@ -1345,7 +1345,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
13451345
ep->xfer_count += len;
13461346
}
13471347

1348-
if(len <= 0U)
1348+
if (ep->xfer_count >= ep->xfer_len)
13491349
{
13501350
fifoemptymsk = 0x1U << epnum;
13511351
/* MBED */

targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_hal_pcd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
14281428
{
14291429
USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
14301430
USB_OTG_EPTypeDef *ep = NULL;
1431-
int32_t len = 0U;
1431+
uint32_t len;
14321432
uint32_t len32b = 0;
14331433
uint32_t fifoemptymsk = 0;
14341434

@@ -1462,7 +1462,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
14621462
ep->xfer_count += len;
14631463
}
14641464

1465-
if(len <= 0)
1465+
if (ep->xfer_count >= ep->xfer_len)
14661466
{
14671467
fifoemptymsk = 0x1 << epnum;
14681468
// Added for MBED PR #3062

0 commit comments

Comments
 (0)