diff options
| author | yygg_you <[email protected]> | 2019-10-10 11:06:21 +0800 |
|---|---|---|
| committer | yygg_you <[email protected]> | 2019-10-10 11:06:21 +0800 |
| commit | 361ee3da9778570d53bb8c3bbaf7964ef3e14ecb (patch) | |
| tree | 3b318c985db533ca2704d4cd5d983e0d8f9ac00e /bsp | |
| parent | 6aa07774bb67918a6cd98e8ae39723ad9bd49f15 (diff) | |
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
Diffstat (limited to 'bsp')
| -rw-r--r-- | bsp/stm32/libraries/HAL_Drivers/drv_gpio.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_gpio.h b/bsp/stm32/libraries/HAL_Drivers/drv_gpio.h index e7a816e9a8..98c704e972 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_gpio.h +++ b/bsp/stm32/libraries/HAL_Drivers/drv_gpio.h @@ -14,9 +14,9 @@ #include <drv_common.h> #include <board.h> -#define __STM32_PORT(port) GPIO##port +#define __STM32_PORT(port) GPIO##port##_BASE -#define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__STM32_PORT(PORTx) - (rt_base_t)GPIOA)/(0x0400UL) )) + PIN) +#define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__STM32_PORT(PORTx) - (rt_base_t)GPIOA_BASE)/(0x0400UL) )) + PIN) #define __STM32_PIN(index, gpio, gpio_index) \ { \ |
