提交 99481cd0 编写于 作者: B Bernard Xiong

[DeviceDrivers] uart configure issue.

uart configure shall not been performed if uart is not open.
上级 45c7f030
......@@ -603,8 +603,18 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
break;
case RT_DEVICE_CTRL_CONFIG:
/* configure device */
serial->ops->configure(serial, (struct serial_configure *)args);
if (args)
{
/* set serial configure */
serial->config = *(struct serial_configure *)args;
if (dev->ref_count)
{
/* serial device has been opened, to configure it */
serial->ops->configure(serial, (struct serial_configure *)args);
}
}
break;
default :
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册