Skip to content

Commit 21812dd

Browse files
committed
Fix GCC build.
1 parent 71d2ccd commit 21812dd

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

hw/bsp/board_mcu.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@
101101
#elif CFG_TUSB_MCU == OPT_MCU_STM32U5
102102
#include "stm32u5xx.h"
103103

104+
#elif CFG_TUSB_MCU == OPT_MCU_STM32G0
105+
#include "stm32g0xx.h"
106+
104107
#elif CFG_TUSB_MCU == OPT_MCU_CXD56
105108
// no header needed
106109

hw/bsp/stm32g0/family.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ INC += \
5151
$(TOP)/$(ST_HAL_DRIVER)/Inc
5252

5353
# For freeRTOS port source
54-
FREERTOS_PORT = ARM_CM0
54+
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM0
5555

5656
# flash target using on-board stlink
5757
flash: flash-stlink

src/portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ TU_ATTR_ALWAYS_INLINE static inline uint16_t pcd_aligned_buffer_size(uint16_t si
184184
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_endpoint(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t wRegValue)
185185
{
186186
#ifdef PMA_32BIT_ACCESS
187+
(void) USBx;
187188
__O uint32_t *reg = (__O uint32_t *)(USB_DRD_BASE + bEpIdx*4);
188189
*reg = wRegValue;
189190
#else
@@ -195,6 +196,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_set_endpoint(USB_TypeDef * USBx, ui
195196
/* GetENDPOINT */
196197
TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_endpoint(USB_TypeDef * USBx, uint32_t bEpIdx) {
197198
#ifdef PMA_32BIT_ACCESS
199+
(void) USBx;
198200
__I uint32_t *reg = (__I uint32_t *)(USB_DRD_BASE + bEpIdx*4);
199201
#else
200202
__I uint16_t *reg = (__I uint16_t *)((&USBx->EP0R) + bEpIdx*2u);
@@ -249,6 +251,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_clear_tx_ep_ctr(USB_TypeDef * USBx,
249251
TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_tx_cnt(USB_TypeDef * USBx, uint32_t bEpIdx)
250252
{
251253
#ifdef PMA_32BIT_ACCESS
254+
(void) USBx;
252255
return (pma32[2*bEpIdx] & 0x03FF0000) >> 16;
253256
#else
254257
__I uint16_t *regPtr = pcd_ep_tx_cnt_ptr(USBx, bEpIdx);
@@ -259,6 +262,7 @@ TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_tx_cnt(USB_TypeDef * USB
259262
TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_rx_cnt(USB_TypeDef * USBx, uint32_t bEpIdx)
260263
{
261264
#ifdef PMA_32BIT_ACCESS
265+
(void) USBx;
262266
return (pma32[2*bEpIdx + 1] & 0x03FF0000) >> 16;
263267
#else
264268
__I uint16_t *regPtr = pcd_ep_rx_cnt_ptr(USBx, bEpIdx);
@@ -285,6 +289,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_address(USB_TypeDef * USBx,
285289
TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_tx_address(USB_TypeDef * USBx, uint32_t bEpIdx)
286290
{
287291
#ifdef PMA_32BIT_ACCESS
292+
(void) USBx;
288293
return pma32[2*bEpIdx] & 0x0000FFFFu ;
289294
#else
290295
return *pcd_btable_word_ptr(USBx,(bEpIdx)*4u + 0u);
@@ -294,6 +299,7 @@ TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_tx_address(USB_TypeDef *
294299
TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_rx_address(USB_TypeDef * USBx, uint32_t bEpIdx)
295300
{
296301
#ifdef PMA_32BIT_ACCESS
302+
(void) USBx;
297303
return pma32[2*bEpIdx + 1] & 0x0000FFFFu;
298304
#else
299305
return *pcd_btable_word_ptr(USBx,(bEpIdx)*4u + 2u);
@@ -303,6 +309,7 @@ TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_rx_address(USB_TypeDef *
303309
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_tx_address(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t addr)
304310
{
305311
#ifdef PMA_32BIT_ACCESS
312+
(void) USBx;
306313
pma32[2*bEpIdx] = (pma32[2*bEpIdx] & 0xFFFF0000u) | (addr & 0x0000FFFCu);
307314
#else
308315
*pcd_btable_word_ptr(USBx,(bEpIdx)*4u + 0u) = addr;
@@ -312,6 +319,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_tx_address(USB_TypeDef * USB
312319
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_rx_address(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t addr)
313320
{
314321
#ifdef PMA_32BIT_ACCESS
322+
(void) USBx;
315323
pma32[2*bEpIdx + 1] = (pma32[2*bEpIdx + 1] & 0xFFFF0000u) | (addr & 0x0000FFFCu);
316324
#else
317325
*pcd_btable_word_ptr(USBx,(bEpIdx)*4u + 2u) = addr;
@@ -321,6 +329,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_rx_address(USB_TypeDef * USB
321329
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_tx_cnt(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t wCount)
322330
{
323331
#ifdef PMA_32BIT_ACCESS
332+
(void) USBx;
324333
pma32[2*bEpIdx] = (pma32[2*bEpIdx] & ~0x03FF0000u) | ((wCount & 0x3FFu) << 16);
325334
#else
326335
__IO uint16_t * reg = pcd_ep_tx_cnt_ptr(USBx, bEpIdx);
@@ -331,6 +340,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_tx_cnt(USB_TypeDef * USBx, u
331340
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_rx_cnt(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t wCount)
332341
{
333342
#ifdef PMA_32BIT_ACCESS
343+
(void) USBx;
334344
pma32[2*bEpIdx + 1] = (pma32[2*bEpIdx + 1] & ~0x03FF0000u) | ((wCount & 0x3FFu) << 16);
335345
#else
336346
__IO uint16_t * reg = pcd_ep_rx_cnt_ptr(USBx, bEpIdx);
@@ -342,6 +352,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_blsize_num_blocks(USB_TypeDe
342352
{
343353
/* Encode into register. When BLSIZE==1, we need to subtract 1 block count */
344354
#ifdef PMA_32BIT_ACCESS
355+
(void) USBx;
345356
pma32[rxtx_idx] = (pma32[rxtx_idx] & 0x0000FFFFu) | (blocksize << 31) | ((numblocks - blocksize) << 26);
346357
#else
347358
__IO uint16_t *pdwReg = pcd_btable_word_ptr(USBx, rxtx_idx*2u + 1u);

0 commit comments

Comments
 (0)