4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-18 18:13:31 +08:00

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

This commit is contained in:
Bright Pan 2014-02-28 18:22:50 +08:00
parent a4cd949519
commit 9ab853aca3

View File

@ -346,20 +346,25 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
switch (cmd)
{
case RT_DEVICE_CTRL_SUSPEND:
/* suspend device */
dev->flag |= RT_DEVICE_FLAG_SUSPENDED;
break;
case RT_DEVICE_CTRL_SUSPEND:
/* suspend device */
dev->flag |= RT_DEVICE_FLAG_SUSPENDED;
break;
case RT_DEVICE_CTRL_RESUME:
/* resume device */
dev->flag &= ~RT_DEVICE_FLAG_SUSPENDED;
break;
case RT_DEVICE_CTRL_RESUME:
/* resume device */
dev->flag &= ~RT_DEVICE_FLAG_SUSPENDED;
break;
case RT_DEVICE_CTRL_CONFIG:
/* configure device */
serial->ops->configure(serial, (struct serial_configure *)args);
break;
case RT_DEVICE_CTRL_CONFIG:
/* configure device */
serial->ops->configure(serial, (struct serial_configure *)args);
break;
default :
/* control device */
serial->ops->control(serial, cmd, args);
break;
}
return RT_EOK;