Merge pull request #242 from bright-pan/master

Fix rt_serial_control() bug for customized command and indent the code
This commit is contained in:
Bernard Xiong 2014-02-28 18:42:53 +08:00
commit 54b693b3a2
1 changed files with 17 additions and 12 deletions

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;