未验证 提交 a5211c70 编写于 作者: 7 7YZ7 提交者: GitHub

[components][drivers][HUST CSE]修复serial_v2.c中可能产生的死循环 (#7394)

上级 7a2bccd1
...@@ -691,11 +691,11 @@ static rt_err_t rt_serial_tx_enable(struct rt_device *dev, ...@@ -691,11 +691,11 @@ static rt_err_t rt_serial_tx_enable(struct rt_device *dev,
serial->ops->control(serial, serial->ops->control(serial,
RT_DEVICE_CTRL_CONFIG, RT_DEVICE_CTRL_CONFIG,
(void *)RT_SERIAL_TX_BLOCKING); (void *)RT_SERIAL_TX_BLOCKING);
rt_memset(&tx_fifo->rb, RT_NULL, sizeof(tx_fifo->rb));
} }
tx_fifo->activated = RT_FALSE; tx_fifo->activated = RT_FALSE;
tx_fifo->put_size = 0; tx_fifo->put_size = 0;
rt_memset(&tx_fifo->rb, RT_NULL, sizeof(tx_fifo->rb));
rt_completion_init(&(tx_fifo->tx_cpt)); rt_completion_init(&(tx_fifo->tx_cpt));
dev->open_flag |= RT_SERIAL_TX_BLOCKING; dev->open_flag |= RT_SERIAL_TX_BLOCKING;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册