diff options
| author | ZYH <[email protected]> | 2018-06-29 11:04:48 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-06-29 11:04:48 +0800 |
| commit | ea0e9b259df224730dedc369293115a11ccd2c35 (patch) | |
| tree | c94dfdc74230879b16212f2f82fffd2cdc7428c4 | |
| parent | 614b2e389c682d218711692aecc93fef39ec5ac2 (diff) | |
| parent | 4a915c33c4984d2a18e844a6b7908ec581386f74 (diff) | |
Merge pull request #1582 from neverxie/stm32-f4xx-bsp
fixed two bugs in drv_gpio.c
| -rw-r--r-- | bsp/stm32f4xx-HAL/drivers/drv_gpio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bsp/stm32f4xx-HAL/drivers/drv_gpio.c b/bsp/stm32f4xx-HAL/drivers/drv_gpio.c index 4906315ddd..c028f7bac0 100644 --- a/bsp/stm32f4xx-HAL/drivers/drv_gpio.c +++ b/bsp/stm32f4xx-HAL/drivers/drv_gpio.c @@ -32,7 +32,7 @@ static GPIO_TypeDef * get_st_gpio(rt_uint16_t gpio_pin) { - switch(gpio_pin >> 8) + switch(gpio_pin & 0xFF00) { case A: #ifdef GPIOA @@ -87,7 +87,7 @@ static GPIO_TypeDef * get_st_gpio(rt_uint16_t gpio_pin) static void drv_clock_enable(rt_uint16_t gpio_pin) { - switch(gpio_pin >> 8) + switch(gpio_pin & 0xFF00) { case A: #ifdef __HAL_RCC_GPIOA_CLK_ENABLE |
