提交 94a5f995 编写于 作者: Z Zhou Yanjie

X1000:drv_uart.c:修复引脚路由中的问题/Fix bugs in pin routing

在配置引脚路由时需要将未使用的引脚配置为输入模式,
否则有可能同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: NZhou Yanjie <zhouyanjie@zoho.com>
上级 a30587ff
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册