提交 9ab853ac 编写于 作者: B Bright Pan

Fix rt_serial_control() bug for customized command and indent the code

上级 a4cd9495
...@@ -346,20 +346,25 @@ static rt_err_t rt_serial_control(struct rt_device *dev, ...@@ -346,20 +346,25 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
switch (cmd) switch (cmd)
{ {
case RT_DEVICE_CTRL_SUSPEND: case RT_DEVICE_CTRL_SUSPEND:
/* suspend device */ /* suspend device */
dev->flag |= RT_DEVICE_FLAG_SUSPENDED; dev->flag |= RT_DEVICE_FLAG_SUSPENDED;
break; break;
case RT_DEVICE_CTRL_RESUME: case RT_DEVICE_CTRL_RESUME:
/* resume device */ /* resume device */
dev->flag &= ~RT_DEVICE_FLAG_SUSPENDED; dev->flag &= ~RT_DEVICE_FLAG_SUSPENDED;
break; break;
case RT_DEVICE_CTRL_CONFIG: case RT_DEVICE_CTRL_CONFIG:
/* configure device */ /* configure device */
serial->ops->configure(serial, (struct serial_configure *)args); serial->ops->configure(serial, (struct serial_configure *)args);
break; break;
default :
/* control device */
serial->ops->control(serial, cmd, args);
break;
} }
return RT_EOK; return RT_EOK;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册