Skip to content

Commit 361ee3d

Browse files
committed
fix warning: #1296
When compiling C code containing statements like this: rt_base_t xx_io_tbl[] = { GET_PIN(A,0), }; the compiler will report: Warning: #1296-D: extended constant initialiser used
1 parent 6aa0777 commit 361ee3d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bsp/stm32/libraries/HAL_Drivers/drv_gpio.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
#include <drv_common.h>
1515
#include <board.h>
1616

17-
#define __STM32_PORT(port) GPIO##port
17+
#define __STM32_PORT(port) GPIO##port##_BASE
1818

19-
#define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__STM32_PORT(PORTx) - (rt_base_t)GPIOA)/(0x0400UL) )) + PIN)
19+
#define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__STM32_PORT(PORTx) - (rt_base_t)GPIOA_BASE)/(0x0400UL) )) + PIN)
2020

2121
#define __STM32_PIN(index, gpio, gpio_index) \
2222
{ \

0 commit comments

Comments
 (0)