4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-02-04 05:45:00 +08:00

Merge pull request #1582 from neverxie/stm32-f4xx-bsp

fixed two bugs in drv_gpio.c
This commit is contained in:
ZYH 2018-06-29 11:04:48 +08:00 committed by GitHub
commit ea0e9b259d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@
static GPIO_TypeDef * get_st_gpio(rt_uint16_t gpio_pin) static GPIO_TypeDef * get_st_gpio(rt_uint16_t gpio_pin)
{ {
switch(gpio_pin >> 8) switch(gpio_pin & 0xFF00)
{ {
case A: case A:
#ifdef GPIOA #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) static void drv_clock_enable(rt_uint16_t gpio_pin)
{ {
switch(gpio_pin >> 8) switch(gpio_pin & 0xFF00)
{ {
case A: case A:
#ifdef __HAL_RCC_GPIOA_CLK_ENABLE #ifdef __HAL_RCC_GPIOA_CLK_ENABLE