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

This commit is contained in:
7YZ7 2023-05-15 14:42:11 +08:00 committed by GitHub
parent 7a2bccd1c2
commit a5211c70b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -691,11 +691,11 @@ static rt_err_t rt_serial_tx_enable(struct rt_device *dev,
serial->ops->control(serial,
RT_DEVICE_CTRL_CONFIG,
(void *)RT_SERIAL_TX_BLOCKING);
rt_memset(&tx_fifo->rb, RT_NULL, sizeof(tx_fifo->rb));
}
tx_fifo->activated = RT_FALSE;
tx_fifo->put_size = 0;
rt_memset(&tx_fifo->rb, RT_NULL, sizeof(tx_fifo->rb));
rt_completion_init(&(tx_fifo->tx_cpt));
dev->open_flag |= RT_SERIAL_TX_BLOCKING;