| 1263 | } |
| 1264 | |
| 1265 | static void _serial_tx_flush(struct rt_serial_device *serial) |
| 1266 | { |
| 1267 | struct rt_serial_tx_fifo *tx_fifo; |
| 1268 | RT_ASSERT(serial != RT_NULL); |
| 1269 | |
| 1270 | if (serial->config.tx_bufsz != 0) |
| 1271 | { |
| 1272 | tx_fifo = (struct rt_serial_tx_fifo *)serial->serial_tx; |
| 1273 | RT_ASSERT(tx_fifo != RT_NULL); |
| 1274 | |
| 1275 | if (rt_atomic_load(&tx_fifo->activated)) |
| 1276 | { |
| 1277 | rt_completion_wait(&tx_fifo->tx_cpt, RT_WAITING_FOREVER); |
| 1278 | } |
| 1279 | } |
| 1280 | } |
| 1281 | |
| 1282 | static rt_err_t _serial_get_unread_bytes_count(struct rt_serial_device *serial, rt_ssize_t *unread_bytes) |
| 1283 | { |
no test coverage detected