Support configure when serial is open.
This commit is contained in:
@ -1121,7 +1121,8 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
|
|||||||
if (args != RT_NULL)
|
if (args != RT_NULL)
|
||||||
{
|
{
|
||||||
struct serial_configure *pconfig = (struct serial_configure *) args;
|
struct serial_configure *pconfig = (struct serial_configure *) args;
|
||||||
if (serial->parent.ref_count)
|
if (((pconfig->rx_bufsz != serial->config.rx_bufsz) || (pconfig->tx_bufsz != serial->config.tx_bufsz))
|
||||||
|
&& serial->parent.ref_count)
|
||||||
{
|
{
|
||||||
/*can not change buffer size*/
|
/*can not change buffer size*/
|
||||||
return -RT_EBUSY;
|
return -RT_EBUSY;
|
||||||
|
Reference in New Issue
Block a user