stm32g0xx: usb: Use correct macro to clear RXBD register block numbers

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
This commit is contained in:
Eya 2023-01-17 23:36:27 +01:00 committed by Marc Kleine-Budde
parent 4a1e646cdb
commit b6d102871e

View File

@ -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) \
{ \
@ -670,7 +670,6 @@ typedef struct
{ \
if ((wCount) == 0U) \
{ \
(pdwReg) &= (uint32_t)~USB_CNTRX_NBLK_MSK; \
(pdwReg) |= USB_CNTRX_BLSIZE; \
} \
else \
@ -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