Skip to content

Commit

Permalink
stm32g0xx: usb: Use correct macro to clear RXBD register block numbers
Browse files Browse the repository at this point in the history
Cherry-picked from upstream commit Fixes: e289146768cf ("[LL][USB] Use
correct macro to clear RXBD register block numbers")

https://github.com/STMicroelectronics/stm32g0xx_hal_driver.git
  • Loading branch information
ASELSTM authored and marckleinebudde committed Feb 13, 2023
1 parent 4a1e646 commit b6d1028
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libs/STM32_HAL/include/stm32g0xx/stm32g0xx_ll_usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ typedef struct
do { \
uint32_t wNBlocks; \
\
(pdwReg) &= USB_PMA_RXBD_COUNTMSK; \
(pdwReg) &= ~(USB_CNTRX_BLSIZE | USB_CNTRX_NBLK_MSK); \
\
if ((wCount) > 62U) \
{ \
Expand All @@ -670,7 +670,6 @@ typedef struct
{ \
if ((wCount) == 0U) \
{ \
(pdwReg) &= (uint32_t)~USB_CNTRX_NBLK_MSK; \
(pdwReg) |= USB_CNTRX_BLSIZE; \
} \
else \
Expand Down Expand Up @@ -709,8 +708,8 @@ typedef struct
* @param bEpChNum Endpoint Number.
* @retval Counter value
*/
#define USB_DRD_GET_CHEP_TX_CNT(USBx, bEpChNum) (((USB_DRD_PMA_BUFF + (bEpChNum))->TXBD & 0x03FF0000U) >>16U)
#define USB_DRD_GET_CHEP_RX_CNT(USBx, bEpChNum) (((USB_DRD_PMA_BUFF + (bEpChNum))->RXBD & 0x03FF0000U) >>16U)
#define USB_DRD_GET_CHEP_TX_CNT(USBx, bEpChNum) (((USB_DRD_PMA_BUFF + (bEpChNum))->TXBD & 0x03FF0000U) >> 16U)
#define USB_DRD_GET_CHEP_RX_CNT(USBx, bEpChNum) (((USB_DRD_PMA_BUFF + (bEpChNum))->RXBD & 0x03FF0000U) >> 16U)

#define USB_DRD_GET_EP_TX_CNT USB_GET_CHEP_TX_CNT
#define USB_DRD_GET_CH_TX_CNT USB_GET_CHEP_TX_CNT
Expand Down

0 comments on commit b6d1028

Please sign in to comment.