From 94a5f9951b77046dfb27f76943e795924b38778b Mon Sep 17 00:00:00 2001 From: Zhou Yanjie Date: Sat, 23 Mar 2019 22:10:48 +0800 Subject: [PATCH] =?UTF-8?q?X1000:drv=5Fuart.c:=E4=BF=AE=E5=A4=8D=E5=BC=95?= =?UTF-8?q?=E8=84=9A=E8=B7=AF=E7=94=B1=E4=B8=AD=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?/Fix=20bugs=20in=20pin=20routing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在配置引脚路由时需要将未使用的引脚配置为输入模式, 否则有可能同u-boot中的配置产生冲突。 Unused pins need to be configured as input mode when configuring pin routing, otherwise there may be conflicts with the configuration in u-boot. Signed-off-by: Zhou Yanjie --- bsp/x1000/drivers/drv_uart.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bsp/x1000/drivers/drv_uart.c b/bsp/x1000/drivers/drv_uart.c index 4c2ab92dcc..71ee1c38c4 100644 --- a/bsp/x1000/drivers/drv_uart.c +++ b/bsp/x1000/drivers/drv_uart.c @@ -285,11 +285,14 @@ void rt_hw_uart_init(void) strcpy(uart->name, "uart2"); #ifdef CONFIG_SYS_UART2_PD + gpio_set_func(GPIO_PORT_C,GPIO_Pin_31,GPIO_INPUT | GPIO_PULL); gpio_set_func(GPIO_PORT_D,GPIO_Pin_4,GPIO_FUNC_0); gpio_set_func(GPIO_PORT_D,GPIO_Pin_5,GPIO_FUNC_0); #else //USE JTAG IO for UART2 - gpio_set_func(GPIO_PORT_C,GPIO_Pin_31,GPIO_FUNC_1); + gpio_set_func(GPIO_PORT_D,GPIO_Pin_4,GPIO_INPUT | GPIO_PULL); + gpio_set_func(GPIO_PORT_D,GPIO_Pin_5,GPIO_INPUT | GPIO_PULL); + gpio_set_func(GPIO_PORT_C,GPIO_Pin_31,GPIO_FUNC_1 | GPIO_PULL); #endif serial->ops = &_uart_ops;