提交 4a915c33 编写于 作者: N neverxie

fixed two bugs to drv_gpio.c

上级 614b2e38
...@@ -32,7 +32,7 @@ ...@@ -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) ...@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册